当创建一个类的对象时,将调用所有祖先的构造函数,该对象从类层次结构的顶部开始并向下移动
class MyClass extends MyBase { public MyClass() { super(); // Injected by the compiler System.out.println("Inside CSub() constructor."); /** from 时 代 J a v a - N o w J a v a . c o m**/ } } class MyBase { public MyBase() { super(); // Injected by the compiler System.out.println("Inside CSuper() constructor."); } } public class Main { public static