1.

Which type of members can’t be accessed in derived classes of a base class?(a) Protected(b) Private(c) Public(d) All can be accessedI had been asked this question at a job interview.I'd like to ask this question from Base Class in section Classes of Object Oriented Programming

Answer»

Right answer is (B) Private

The explanation: The private members can be accessed only INSIDE the base CLASS. If the class is derived by other classes. Those members will not be ACCESSIBLE. This concept of OOP is made to make the members more secure.



Discussion

No Comment Found

Related InterviewSolutions