class Demo5_Extends {
public static void main(String[] args) {
Son s = new Son("儿子",35);
Son s1 = new Son();
System.out.println(s.name + "..." + s.age);
}
}
class Father extends Object {
String name;
int age;
public Father() {
}
public Father(String name,int age) {
this.name = name;
this.age = age;
}
}
class Son extends Father {
public Son(){
}
public Son(String name,int age){
super(name,age);
}
}