Single Inheritance Versus Multiple Inheritance

With single inheritance, a class has one set of parents—that is, there is one chain of superclasses (e.g., a car is a motor vehicle, which is a vehicle). Multiple inheritance involves more than one chain of superclasses (e.g., an amphibious vehicle is a motor vehicle, which is a vehicle, and an amphibious vehicle is a water vehicle, which is a vehicle). There can be numerous problems associated with multiple inheritance—for example, name clashes and multiple copies of inherited features. How the problems are overcome is very language dependent from the use of special features of C++ (e.g., virtual base classes) to lack of support for multiple inheritance altogether (PowerBuilder). Multiple inheritance ...

Get Visual Modeling with Rational Rose 2002 and UML 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.