1,每一个类在默认情况下,都会有一个无参数构造器!
2,当显示申明了带参构造器,那么无参构造器就不存在了,需要无参构造器,就必须重新申明!
3,构造器是不能够继承的
4,在类构造器中,无论是有参数还是无参数构造器,默认情况下,首先会调用父类的无参构造器(一直到最上层的父类),这是因为要调用父类继承下来的方法必须要先初始化父类.
5,需要在子类构造器中调用父类其它的构造器,可以显示申明。
1,每一个类在默认情况下,都会有一个无参数构造器!
2,当显示申明了带参构造器,那么无参构造器就不存在了,需要无参构造器,就必须重新申明!
3,构造器是不能够继承的
4,在类构造器中,无论是有参数还是无参数构造器,默认情况下,首先会调用父类的无参构造器(一直到最上层的父类),这是因为要调用父类继承下来的方法必须要先初始化父类.
5,需要在子类构造器中调用父类其它的构造器,可以显示申明。