/*
* 创建子类对象是象调用父类构造器后调用子类构造器
* */
public class ExtExample {
public static void main(String[] args) {
SuperClass s = new SubClass();
}
}
abstract class SuperClass{
public SuperClass(){
System.out.println("父类构造器");
}
}
class SubClass extends SuperClass{
public SubClass(){
System.out.println("子类构造器");
}
}