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

📄 nativeexample.java

📁 北大Java 语言程序设计 ppt课件及源码
💻 JAVA
字号:
public class NativeExample {    private int myValue;    static {        Runtime.getRuntime().loadLibrary("example");    }    NativeExample(int v) {        myValue = v;    }    native static String quote(int index) throws IllegalArgumentException;    native int twoTimes();    native NativeExample doubleUp();    public static void main(String[] args) {        String s = quote(2);        System.out.println("Testing quote(): \"" + s + "\"");        NativeExample ne = new NativeExample(13);        System.out.println("Testing twoTimes() " + ne.twoTimes() +                            " (should be 26)");        ne = new NativeExample(24);        NativeExample ne2 = ne.doubleUp();        System.out.println("Testing doubleUp() " + ne2 + " (should be 48)");    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -