1.

Which among the following is correct for a hierarchical inheritance?(a) Two base classes can be used to be derived into one single class(b) Two or more classes can be derived into one class(c) One base class can be derived into other two derived classes or more(d) One base class can be derived into only 2 classesThe question was asked in an international level competition.I need to ask this question from Inheritance topic in portion Inheritance & its Types of Object Oriented Programming

Answer»

The CORRECT OPTION is (c) One base class can be DERIVED into other two derived classes or more

Best explanation: One base class can be derived into the other two derived classes or more. If only one class GETS derived by only 2 other classes, it is also hierarchical INHERITANCE, but it is not a mandatory condition, because any number of derived classes can be there.



Discussion

No Comment Found

Related InterviewSolutions