摘要: 1 import java.util.Scanner; 2 3 class Number{ //静态方法计数 4 static int number=0; 5 static void show() { 6 ++number; //计数器 7 System.out.println("目前创建了"+nu 阅读全文
posted @ 2019-10-16 15:19 不懂就要问! 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 反编译:是指通过对他人软件的目标程序(比如可执行程序)进行“逆向分析、研究”工作,以推导出他人的软件产品所使用的思路、原理、结构、算法、处理过程、运行方法等设计要素,某些特定情况下可能推导出源代码。反编译作为自己开发软件时的参考,或者直接用于自己的软件产品中。 测试代码: 1 public clas 阅读全文
posted @ 2019-10-16 13:37 不懂就要问! 阅读(270) 评论(0) 推荐(0) 编辑
摘要: 1 public class Test3 { 2 //类的实例变量 3 int x=1; 4 //类的静态变量初始值为2 5 static int y=2; //类的静态变量初始值为2 6 //静态方法 7 public static void out() { 8 System.out.printl 阅读全文
posted @ 2019-10-16 13:02 不懂就要问! 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 测试静态初始化模块执行顺序的程序: 1 class Root 2 { 3 static{ 4 System.out.println("Root的静态初始化块"); 5 } 6 { 7 System.out.println("Root的普通初始化块"); 8 } 9 public Root() 10 阅读全文
posted @ 2019-10-16 12:49 不懂就要问! 阅读(272) 评论(0) 推荐(0) 编辑
摘要: 1 public class Test2 { 2 { //类的初始化块 3 field=200; 4 } 5 public int field=100; //字段的初始值 6 public Test2(int value) { //类的构造方法 7 this.field=value; 8 } 9 1 阅读全文
posted @ 2019-10-16 12:31 不懂就要问! 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 以下代码无法通过编译: public class Test1 { public static void main(String[] args) { //int a=6; Foo obj=new Foo(); } } class Foo{ int value; public Foo(int initV 阅读全文
posted @ 2019-10-16 11:18 不懂就要问! 阅读(717) 评论(0) 推荐(0) 编辑