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.

Syntax:
Class BaseA
{
//body
}
Class DerivedB:public BaseA
{
//body
}
Class DerivedC:public BaseA
{
//body
}
Class Derived:public BaseA
{
//body
}
You must log in to post a comment.