primitivearrayexample.java
来自「< Professional Java,JDK 5 Edition>」· Java 代码 · 共 26 行
JAVA
26 行
public class PrimitiveArrayExample {
public native boolean sortIntArray(int[] numbers);
static {
System.loadLibrary("PrimitiveArrayLibrary");
}
public static void main(String args[])
{
PrimitiveArrayExample pae = new PrimitiveArrayExample();
int numberList[] = {4, 1, 2, 20, 11, 7, 2};
if(pae.sortIntArray(numberList)) {
System.out.print("The sorted numbers are: ");
for(int i=0; i<numberList.length; i++) {
System.out.print(numberList[i] + " ");
}
System.out.println();
} else {
System.out.println("The sort operation failed because " +
"the memory could not be used directly.");
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?