⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nativeexample.java

📁 程序练习中包括书中实例程序代码和练习中要用到的代码,是压缩文件
💻 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 + -