Commit 3b49154c authored by Martin Deinhofer's avatar Martin Deinhofer
Browse files

renamed package of HelloJNI to java_exercises8_1_1

parent 6c4eb0e8
package java_exercises7_2_1;
public class HelloJNI {
static {
System.loadLibrary("java_exercises7_2_1_HelloJNI"); // Load native library at runtime. In this case the library
// name has the java package prefixed to make the lib name
// unique.
// Declare native methods with the keyword 'native'. Only the signature is
// provided, the implementation is in the native library.
private native void sayHello();
public native int intMethod(int n);
public native boolean booleanMethod(boolean bool);
public native String stringMethod(String text);
// Test Driver
public static void main(String[] args) {
HelloJNI helloJNI = new HelloJNI();
System.out.println("returned native nr: " + helloJNI.intMethod(2));
System.out.println("Returned boolean value: " + helloJNI.booleanMethod(true));
System.out.println("Returned string value: " + helloJNI.stringMethod("Test String"));
package java_exercises7_1_1;
package java_exercises8_1_1;
public class HelloJNI {
static {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment