May 2012
Intermediate to advanced
679 pages
16h 56m
English
Hierarchical inheritance signifies one base and many derived classes. This is a very common form of inheritance in practice. In our opinion, it is not different from single inheritance. Consider that “A” is a base class and “B”, ”C” and “D” are derived classes. This is shown in Figure 10.3. The pairs (A and B), (A and C) and (A and D) can be considered as examples of single inheritance. In addition, there is no interaction between different derived classes. Rules for defining such classes and defining constructors for derived classes are absolutely same as single inheritance.
We will see this type of inheritance again in Chapter 13 “Polymorphism”.
Figure 10.3 Hierarchical inheritance
Read now
Unlock full access