This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
From the very moment I learnt Java doesnt support multiple inheritance, the question raised in me...Why not multiple inheritance?Whats going to really go wrong when someone extends more than 1 class?Its kind of bugging me... Any real reason???Wondering what that might be..
page no 100....kathy book says......simple explaination ever why java doesnot support multiple inheritance
Some languages (like C++) allow a class to extend more than one other class.
This capability is known as "multiple inheritance." The reason that Java's
creators chose not to allow multiple inheritance is that it can become quite
messy. In a nutshell, the problem is that if a class extended two other classes,
and both superclasses had, say, a doStuff() method, which version of doStuff()
would the subclass inherit? This issue can lead to a scenario known as the
"Deadly Diamond of Death," because of the shape of the class diagram that
can be created in a multiple inheritance design. The diamond is formed when
classes B and C both extend A, and both B and C inherit a method from A. If
class D extends both B and C, and both B and C have overridden the method
in A, class D has, in theory, inherited two different implementations of the
same method. Drawn as a class diagram, the shape of the four classes looks
like a diamond.