The callingPLI class also includes a main method to instantiate the class and call the native method. The main method instantiates callingPLI and calls the callToPLI() native method.
The complete definition of the callingPLI class, including all the points addressed above in this section, looks like this:
public class callingPLI {
public native void callToPLI();
static {
System.loadLibrary("hiFromPLI");
}
public static void main(String[] argv) {
callingPLI callPLI = new callingPLI();
callPLI.callToPLI();
System.out.println("And Hello from Java, too!");
}
}