class ExtendsDemo
{
public static void main(String [] args)
{
Zi z = new Zi("wang",10);
}
}
class Fu
{
//public Fu(){}
public Fu(String s){
System.out.println("Fu 有参构造:"+s);
}
}
class Zi extends Fu
{
public Zi(){
super("无参");
System.out.println("Zi 无参构造");
}
public Zi(String s){
this();
System.out.println("Zi 有参构造:"+s);
}
public Zi(String s,int a)
{
this(s);
System.out.println("Zi 两个参构造:"+s+"***"+a);
}
} |
|