May 2012
Intermediate to advanced
679 pages
16h 56m
English
After studying inheritance in detail, we are in a position to study two cases where two classes are related to each other. It is tempting to call it inheritance relationships. However, it must be noted that this term is not defined in literature. The two relations are termed as “is–a” and “has–a” relationships.
Figure 10.10 Multilevel inheritance with multiple paths
Consider a simple example. We may have a base class as vehicle. The classes car and motorcycle may be derived from it. Now the relationship between derived class and base class can best be described as “is–a” relationship. A car is ...
Read now
Unlock full access