public void testMethod(){ Test1 t1 = new Test1(); t1.my(); } public static void main(String[] args) { Test t = new Test(); t.testMethod(); } class Test1{ public void my(){ String tag = this.getMyGrandpaStackTrace(); System.err.println(String.format("
public class TestExtends { public static void main(String[]args){ int s = 10; System.out.println(System.identityHashCode(s)); s=3*s; int num = 30; System.out.println(System.identityHashCode(s)); System.out.println(System.identityHashCode(num));} 输出 4
一.首先是java运行环境的搭建,到官网下载java jdk安装即可(注意要修改环境变量).还可以顺便安装eclipse. 二.编写java代码,文件名HelloWorld.java public class HelloWorld { public native void displayHelloWorld(); public static void main(String[] args) { HelloWorld hw = new HelloWorld(); hw.displayHelloWo