Home Segments Top Top Previous Next

360: Sidetrip

The designers of Java deliberately did not provide for multiple inheritance, because multiple inheritance introduces problems. For example, if multiple branches in an inheritance hierarchy provide an instance method or instance-variable value, then language designers have to decide which branch dominates the others. C++ resolves the problem by complaining about ambiguity at compile time. Other languages, such as Lisp, resolve the problem by using an elaborate ordering mechanism called topological sorting.