一、编写Java类
package test;
public class TestJNI
{
public native int add(int a,int b);
public native String upperCase(String str);
static
{
System.loadLibrary("JniDll");
}
public static void main(String[] args)
{
TestJNI test = new TestJNI();
int a=100, b=20, result;
result = test.add(a, b);
System.out.println("sum:" + result);
String str1, str2,str3;
str1 = "abcDEFhijk";
str3 = "eahis";
str2=test.upperCase(str1);
System.out.println(str2);
}
}package test;
public class Test