// AskOp.java -- demo for calling PrintOp and PrintOpReply intrinsics class AskOp { // these will be implemented as native method calls... public static native void printOp( String msg ); public static native String printOpReply( String msg ); // and here is a little main program calling them... public static void main( String args[] ) { System.loadLibrary("XY"); // loads the libXY.sl library System.out.println( "testing printOp" ); printOp( "Hello Operator, testing Java Native Interface" ); System.out.println( "testing printOpReply" ); String answer = printOpReply("Could you please reply OK?"); System.out.println( "operator replied " + answer ); } } // do not forget to run javah -jni against this file to create AskOp.h