class Fu extends Object
{
int num ;
Fu()
{
super();
System.out.println("fu run");
}
Fu(int x)
{
System.out.println("fu run "+x);
}
}
class Zi extends Fu
{
Zi()
{
super();
System.out.println("zi run"+num);
}
Zi(int x)
{
this();
System.out.println("zi run"+x);
}
}
class ExtendsDemo4
{
public static void main(String[] args)
{
new Zi(6);
}
}
晕,对运行结果不太理解,
结果如下:
fu run
zi run0
zi run6
不明白为什么是这样??
求指教。
|
|