日期:2014-05-20 浏览次数:20791 次
package test4;
public class People {
String name;
public People(String name) {
System.out.print(2);
this.name = name;
}
public People() {
System.out.print(1);
}
public static void main(String[] args) {
new Child("MIKE");
}
}
class Child extends People {
People father;
public Child(String name) {
System.out.print(3);
this.name = name;
father = new People(name + ":F");
}
public Child() {
System.out.print(4);
}
}