1.

Do members of base class gets divided among all of its child classes?(a) Yes, equally(b) Yes, depending ontype of inheritance(c) No, it’s doesn’t get divided(d) No, it may or may not get dividedThe question was posed to me in class test.The origin of the question is Hierarchical Inheritance in portion Inheritance & its Types of Object Oriented Programming

Answer»

The correct option is (c) No, it’s doesn’t get DIVIDED

The explanation: The CLASS members doesn’t get divided AMONG the child classes. All the members get derived to each of the subclasses as whole. The only restriction is from the ACCESS SPECIFIERS used.



Discussion

No Comment Found

Related InterviewSolutions