class ConstructCallThisAndSuper { public static void main(String[] args) { Person p=new Graduate(); } } class Person { String name; int age; Person(String name,int age)//*******3333 { this.name=name; this.age=age; System.out.println("第一: Person(String,int)");//第一打印 返回******22222 } } class Student extends Person { String school; Student() //*****1111 { this(null,0,null); //跳到******22222 System.out.println("第三: Student()");//第三打印 返回*****11111 } Student(String name,int age,String school) ///*****22222 { super(name,age);//跳到*****33333 this.school=school; System.out.println("第二: Student(String,int,String)");//第二 打印 返回******22222 } } class Graduate extends Student { //自动加上super() 跳到******1111 Graduate() { System.out.println("最后: Graduate()");//最后打印 } }
构造函数是这样运行的吗??