[BAEL-4204] JNA (#10113)

* [BAEL-4203] JNA

* [BAEL-4203] JNA
This commit is contained in:
psevestre
2020-10-01 17:13:15 -03:00
committed by GitHub
parent 5a8f420807
commit 3dddb550b6
28 changed files with 225 additions and 16 deletions
@@ -0,0 +1,20 @@
package com.baeldung.jni;
public class ExampleParametersJNI {
static {
System.loadLibrary("native");
}
public static void main(String[] args) {
System.out.println("Java: My full name: " + new ExampleParametersJNI().sayHelloToMe("Martin", false));
long sumFromNative = new ExampleParametersJNI().sumIntegers(456, 44);
System.out.println("Java: The sum coming from native code is: " + sumFromNative);
}
// Declare another method sumIntegers that receives two integers and return a long with the sum
public native long sumIntegers(int first, int second);
// Declare another method sayHelloToMe that receives the name and gender and returns the proper salutation
public native String sayHelloToMe(String name, boolean isFemale);
}