摘要: 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 阅读全文
posted @ 2016-05-23 21:38 di306 阅读(5708) 评论(0) 推荐(0) 编辑
摘要: java程序运行时,若存在static{}静态块,则, 程序先执行静态块,然后执行相应的构造函数 如果存在子类,则在实例化时, 首先执行父类的static{},然后执行子类的static{},然后执行父类的构造函数,最后执行子类的构造函数 阅读全文
posted @ 2016-05-23 16:08 di306 阅读(159) 评论(0) 推荐(0) 编辑