1.

Which among the following is best to define hierarchical inheritance?(a) More than one classes being derived from one class(b) More than 2 classes being derived from single base class(c) At most 2 classes being derived from single base class(d) At most 1 class derived from another classThis question was posed to me in my homework.This is a very interesting question from Hierarchical Inheritance in chapter Inheritance & its Types of Object Oriented Programming

Answer»

Right option is (a) More than one classes being DERIVED from one class

Easiest explanation - When two or more classes get derived from a single base class, it is known as hierarchical INHERITANCE. This gives US freedom to use same code with DIFFERENT scopes and flexibility into different classes.



Discussion

No Comment Found

Related InterviewSolutions