Hierarchical Inheritance

Another interesting application of inheritance is to use is as a support to a hierarchical design of a class program. Many programming problems can be cast into a hierarchy where certain features of one level are shared by many others.

Hierarchical Inheritance
Hierarchical Inheritance

Syntax:

Class BaseA  
{
       //body
}
Class DerivedB:public BaseA
{
     //body
}
Class DerivedC:public BaseA
{
     //body
}
Class Derived:public BaseA
{
    //body
}

Related posts