Why we can not extend more than one class in java? can anyone clearify this point please.
6 Answers
That's a design decision - see e.g. Why not multiple inheritance for the rationale. Short reason: MI is complex, Java doesn't want to be complex.
1 Comment
James Gosling / Henry McGilton:
Multiple inheritance - and all the problems it generates - was discarded from Java. The desirable features of multiple inheritance are provided by interfaces - conceptually similar to Objective C protocols. An interface is not a definition of a class. Rather, it's a definition of a set of methods that one or more classes will implement. An important issue of interfaces is that they declare only methods and constants. Variables may not be defined in interfaces.
In other words, it eliminates the problems of ambiguity ("A" inherits "B" and "C", "B" and "C" inherits "D" - is "A" "D"?).
Instead of multiple class inheritanse, in Java you should use multiple interface inheritance. Interfaces describes behavior of object and there are no ambiguities.