Hybrid inheritance is combination of two or more inheritances such as single, multiple, multilevel or Hierarchical inheritances. There could be situations where we need to apply two or more types of inheritance to design a program.

Syntax:
Class BaseA // Base class for Class C
{
//body
}
Class BaseB : public BaseA
{
//body
}
Class BaseC
{
//body
}
Class Derived : public B
aseB,public BaseC
{
//body
}
Here, Class Derived is inheriting the property of class BaseB and BaseC. Class BaseB inheriting the class BaseA.
You must log in to post a comment.