📄 cnative.java
字号:
/*源程序清单12-12*/
package test;
public class cNative
{
public native void testNative(int m); //声明本地方法
static
{
System.loadLibrary("dllNative");
}
//装载动态连接库文件,设以后要生成的动态连接库文件名为dllNative.dll
public cNative()
{
}
public void printStr(int m)
{
String str="";
for(int i=0;i<m;i++) str+=i+" ";
System.out.println(str);
}
public static void main(String[] args)
{
System.out.println("Java call VC method.");
(new cNative()).testNative(4); //调用VC本地方法
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -