要这样改:
..
int i;
int j=10;
public static void main(String args[])
{
int a[]={2,2,2,2,2,2,2,2,2,2};//if regard a[] as a member var of Class NativeDemo,it's not accessable because main() is static.
String b="bbbbbbbbbbbbbb"; // reason ibidem
NativeDemo ob = new NativeDemo();
ob.i = 10;
ob.test(b);
ob.test1();
ob.test2(a,j);
}
public native int test( String b);
public native int test1();
public native int test2(int a[],int j);
static
{
System.loadLibrary("Dllsam");
}
...
..
int i;
int j=10;
public static void main(String args[])
{
int a[]={2,2,2,2,2,2,2,2,2,2};//if regard a[] as a member var of Class NativeDemo,it's not accessable because main() is static.
String b="bbbbbbbbbbbbbb"; // reason ibidem
NativeDemo ob = new NativeDemo();
ob.i = 10;
ob.test(b);
ob.test1();
ob.test2(a,j);
}
public native int test( String b);
public native int test1();
public native int test2(int a[],int j);
static
{
System.loadLibrary("Dllsam");
}
...
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货