Default constructor (created by system automatically) is public? or default access? Or depending on the access keyword of the class?? Thanks
g*g
2 楼
public
default
【在 o*****n 的大作中提到】 : Default constructor (created by system automatically) is public? or default : access? Or depending on the access keyword of the class?? : Thanks
o*n
3 楼
那为什么: Given: class A { A() { } } class B extends A { } Which statement is true? a). Class B's constructor is public. b). Class B has no constructors. c). Class B's constructor includes a call to this(). d). Class B's constructor includes a call to super(). A不对,d对呢?还是A,D都对?
【在 g*****g 的大作中提到】 : public : : default
g*g
4 楼
Sorry, I was wrong, the default constructor has the same access modifier as the class itself,
【在 g*****g 的大作中提到】 : public : : default
o*n
5 楼
Do you have any reference? I also think so, but just not sure. And I need to tell more than 20 students regarding this:)
【在 g*****g 的大作中提到】 : Sorry, I was wrong, the default constructor has the same access modifier : as the class itself,