class Fu {
int num ;
Fu(){
num = 60;
System.out.println("fu fun"+num);
}
Fu(int x){
System.out.println("fu......"+x);
}
}
class Zi extends Fu{
Zi(){
super();
System.out.println("zi fun");
}
Zi(int x){
this();
System.out.println("zi......"+x);
}
}
class ExtendsDemo5 {
public static void main(String[] args){
Zi z1 = new Zi(4);
}
}
结果是什么呢?最好能推理得到,求说明下继承在开发中的作用。。。。。。感觉很不明继承的作用{:2_33:} |
|