读书人

JVM加载机制您知多少是否真的知道

发布时间: 2013-09-06 10:17:17 作者: rapoo

JVM加载机制你知多少,是否真的知道,来猜猜这题的答案你就知道了。

题:JVM加载机制你知多少,是否真的知道,来猜猜这题的答案你就知道了。


不要太相信自己哦,猜完之后自己测试下(也可以回复博客让我来揭晓答案),大家给下第一映像的答案,顺便调查下。


================================================大胆给出你的答案==================================================



public class Test3_JVM {

static Test3_JVM test = new Test3_JVM();
static int a = 0;
public Test3_JVM(){
a ++;
System.out.println(a + ":constructor");
}
public static void show(){
System.out.println(a + ":show");
}
public static void main(String[] args) {
Test3_JVM.show();
new Test3_JVM();
new Test3_JVM();
System.out.println(Test3_JVM.a);
System.out.println(Test3_JVM.a);
Test3_JVM.show();
}

}






================================================大胆给出你的答案==============================================


答案:稍微加密下,省的你偷懒,选中下就可以看到答案。手机用户可以回复等我给你答案。

1:constructor
0:show
1:constructor
2:constructor
2
2
2:show



1楼kolnick前天 12:49
.......

读书人网 >编程

热点推荐