May 2012
Intermediate to advanced
679 pages
16h 56m
English
So far we have discussed single and multiple and hierarchical inheritance. In all the cases, we had only two levels of classes namely derived class level and base class level. It may be called as single level inheritance. Consider a case that a class A is derived from class B. However, class B is itself derived from class C. It will make three levels of classes and two levels of inheritance. In some books, it is called multilevel inheritance. This type of inheritance is illustrated withFigure 10.4.
Access specifier “protected” is very much useful in this type of inheritance. Let us study it with a simple program.
Figure 10.4 Multilevel inheritance
Problem: Write a program to demonstrate multilevel inheritance ...
Read now
Unlock full access