父类:
package test;
public class FatherClass {
public FatherClass() {
System.out.println("FatherClass Create");
}
}
子类:
package test;
import test.FatherClass;
public class ChildClass extends FatherClass {
public ChildClass() {
System.out.println("ChildClass Create");
}
public static void main(String[] args) {
FatherClass fc = new FatherClass();
ChildClass cc = new ChildClass();
}
}
输出结果:
C:>java test.ChildClass
FatherClass Create
FatherClass Create 这里怎么打印两次父类的呢?!!
ChildClass Create |