摘要:
1 class Glyph { 2 void draw() { 3 System.out.println("Glyph.draw()"); 4 } 5 Glyph() { 6 System.out.println("Glyph() before draw()"); 7 draw(); 8 Syste 阅读全文
摘要:
java程序运行时,若存在static{}静态块,则, 程序先执行静态块,然后执行相应的构造函数 如果存在子类,则在实例化时, 首先执行父类的static{},然后执行子类的static{},然后执行父类的构造函数,最后执行子类的构造函数 阅读全文