📄 nativeexample.java
字号:
/** A class that uses a native method
* This class is assigned to the default package
*/
public class NativeExample {
/** the method increment is a wrapper for a C
* function that resides in NativeExample.dll
* @param input an int value that the C
* function increments
*/
public static native int increment( int input );
/** test main method passes the value 4
* to the native method and prints incremented
* value returned by the native method
* @param args not used
*/
public static void main( String[] args ) {
System.out.println( increment( 4 ) );
System.out.println(
"Native method called successfully" );
}
static { // static initialization block
System.loadLibrary ( "NativeExample" );
System.out.println (
"Library Loaded Successfully" );
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -