Search:     Advanced search
Browse by category:
C/C++   |   Java   |   Oracle/Database   |   SAP   |   ASP .NET   |   Mainframe-DB2   |   Freshers

An application needs to load a library before it starts to run, how to code?

Add comment
Views: 323
Votes: 0
Comments: 0
One option is to use a static block to load a library before anything is called. For example,
class Test {
static {
System.loadLibrary("path-to-library-file");
}
....
}
When you call new Test (), the static block will be called first before any initialization happens. Note that the static block position may matter.
Others in this Category
document What is the difference between the getRequestDispatcher(String path) method of javax.servlet.ServletRequest interface and javax.servlet.ServletContext interface?
document Explain the directory structure of a web application.
document What is the difference between preemptive scheduling and time slicing?
document Q: State the significance of public, private, protected, default modifiers both singly and in combination and state the effect of package relationships on declared items qualified by these modifiers.
document Is it necessary that each try block must be followed by a catch block?
document Can a ArrayList contain heterogenous objects?
document What is the use of BytesMessage?
document Java Tutorial
document What is the purpose of finalization?
document How you will make available any Message Resources Definitions file to the Struts Framework Environment?
» More articles



RSS