Types Of Inheritances:
There are 5 types of Inheritances used in C++:
1) Single Inheritance
2) Multilevel Inheritance
3) Hierarchial Inheritance
4) Hybrid Inheritance
5) Multiple Inheritance
As Shown in Figure:
Accessibility Modes in Inheritance in C++:
We can use the following table to understand the accessibility of the members in different modes of Inheritance:
Here, by 'X' we mean that, that object is not inheritable. Remember, Private objects and functions are never inherited. I'll be discussing about these types of inheritances individually in my next post.
Do you like this post? Please link back to this article by copying one of the codes below.
URL: HTML link code: Forum link code: