本帖最后由 dongyangzhang 于 2013-6-11 21:49 编辑
class X { Yb = new Y(); X(){ System.out.print("X"); } }
class Y { Y(){ System.out.print("Y"); } }
public class Z extends X { Yy = new Y(); Z(){ System.out.print("Z"); }
publicstatic void main(String[] args) { new Z();//这里先new class A对象,然后在new出Z 对象,所以输出是YXYZ,请问这样理解对吗? } }
|