总是忘了,还是记下来吧~~

With super(), the superclass no-argument constructor is called.

With super(parameter list), the superclass constructor with a matching parameter list is called.

如果父类中没有构造器,那么Java编译器就会自动插入一个对父类无参数的构造器的调用。

然后,super还可以调用父类的方法:

super.aMethod();

posted on 2017-03-17 11:23  BoGummyYoung  阅读(112)  评论(0编辑  收藏  举报