java中继承与初始化顺序
摘要:
该代码从Thinking in java第四版中拷贝,很好的反应了java中含有static成员与方法的继承初始化顺序,推荐阅读Thinking in java的原文。代码如下:class Insect { private int i = 9; protected int j; Insect(){ System.out.println("i = " + i + ", j = " + j); j = 49; } private static int x1 = printInit("static Insect.x1 initialized" 阅读全文
posted @ 2013-10-04 17:22 明宇 阅读(239) 评论(0) 推荐(0) 编辑