1.

Deriving a class in such a way that that the base class members are not available for further inheritance is known as ___________________(a) Public inheritance(b) Protected inheritance(c) Protected or private inheritance(d) Private inheritanceI got this question in an online quiz.My doubt stems from Derived Class in portion Classes of Object Oriented Programming

Answer»

The correct option is (d) PRIVATE INHERITANCE

Explanation: The private members of a class can NEVER be derived to another class. When a class derives another class using private inheritance, all the members become private members of the derived class. Hence these member won’t be AVAILABLE for further inheritance.



Discussion

No Comment Found

Related InterviewSolutions