Chapter 13

Multiple Inheritance

At the heart of the concept of inheritance is the is-a relationship. Viewed in one way, the is-a relationship is a form of classification. For example, a TextWindow can be classified as a type of Window, and therefore it makes sense that the class TextWindow can be created by inheritance from class Window. Expressed another way, the category TextWindow is a subset of the more general category Window.

Images

However, when we look at classifications of objects in the real world, they seldom fit the simple single parent hierarchies we have been constructing. This is because real world objects are almost always classified ...

Get An Introduction to Object-Oriented Programming, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.