I think the simplest answer for why java doesn't support multiple inheritance is that the people who designed the language felt that having it caused more problems than it solved.
As I understand it, the idea was (in part) to remove the complicated, esoteric stuff that caused LOTS of headaches from C/C++, and keep the 'good' stuff. Who's definition of good? That would be those designers.
Whether they were right or wrong can be debated, and will be for a long time.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
posted 10 years ago
Multiple inheritance means that a class can obtain working functionality from more than one source. Since only classes and enums can embody functionality, it would mean a class can inherit directly from several classes. This is called diamond inheritance, because you can draw diagrams like thisThere is a very similar diagram in B Meyer, Object-Oriented Software Construction 2/e (I think 1998).
The problem is that there might be methods with the same name and different functionality in the different branches. Eiffel (Meyer's language) insists one of the methods be renamed; obviously when Java was developed Gosling et al thought this was too complicated an prohibited multiple inheritance. When Microsoft developed C# a few years later, they also only permitted single inheritance.
There are several ways to mimic multiple inherita
Multiple interfaces. Since interfaces are empty, they don't inherit any functionality, and the collision problem is greatly reduced.
"Favour Composition over Inheritance." By using fields which are objects of a superclass you can get one inheritance hierarchy in the class and another in the fields, which gives most of the benefits of multiple inheritance.
Does that help? [ April 09, 2008: Message edited by: Campbell Ritchie ]