1.

If a class has all the private members, which specifier will be used for its implicit constructor?(a) Private(b) Public(c) Protected(d) DefaultI had been asked this question in homework.My question is from Access Specifiers in portion Access Specifiers of Object Oriented Programming

Answer»

Correct option is (B) Public

Best explanation: The implicit constructor will always be public. Otherwise the class wouldn’t be ABLE to have instances. In TURN, no OBJECTS will be created and the class can only be USED for inheritance.



Discussion

No Comment Found

Related InterviewSolutions