1.1当父类中同时有无参和有参构造函数时,子类继承父类,调用子类的无参构造函数,这是无论写不写super();其结果都一样,都是先调用父类的无参构造,再调用子类的无参构造,代码如下
class Father{ String s="aaaaaaaa"; public Father(String s) { this.s = s; System.out.println(s+"我是father有参构造"); } public Father() { System.out.println(s+"我是father无参构造"); } } class