class Fu
{
int num ;
Fu()
{
num =10;
System.out.println("A fu run");
}
Fu(int x)
{
System.out.println("B fu run..."+x);
}
}
class Zi extends Fu
{
int num;
Zi()
{
//super();//调用的就是父类中的空参数的构造函数。
System.out.println("C zi run"+num);
}
Zi(int x)
{
this();
//super();
// super(x);
System.out.println("D zi run "+x);
}
}
class ExtendsDemo4
{
public static void main(String[] args)
{
new Zi(6);
}
}
class Demo//extends Object
{
/*
Demo()
{
super();
return;
}
*/
}
new Zi(6);这句话在内存中的初始化流程是什么?请各位大侠指教
|