classFu{int num ;Fu(){
num =10;
System.out.println("A fu run");}Fu(int x){
System.out.println("B fu run..."+x);}}classZiextendsFu{int num;Zi(){//super();//调用的就是父类中的空参数的构造函数。//类似于this() 调用的是本类的构造函数
System.out.println("C zi run"+num);}Zi(int x){this();// super(x); //如果需要调用父类中带参数的构造函数,可以在子类构造函数中定义。
System.out.println("D zi run "+x);}}classExtendsDemo4{publicstaticvoidmain(String[] args){newZi(6);}}classDemo//extends Object //Object是所有类的父类{/*
Demo()
{
super();
return;
}
*/}