Why no multiple inheritance in java?

Why does the java language not support inheritance? Thanks.Shravan
[87 byte] By [pgshravan] at [2007-9-30 18:31:04]
# 1
1. It's a pain in the *** to implement.2. It can be a pain in the *** to debug.3. Java does support multiple inheritance, but only of interface.
ehodges at 2007-7-6 20:11:20 > top of Java-index,Java Essentials,Java Programming...
# 2
> Why does the java language not support inheritance?> Thanks.> ShravanI'll turn the question around:Why do you think that java should support multiple inheritance?
xiarcel at 2007-7-6 20:11:20 > top of Java-index,Java Essentials,Java Programming...
# 3
> > Why does the java language not support inheritance?> > Thanks.> > Shravan> try looking here. http://www.javaworld.com/javaqa/2002-07/02-qa-0719-multinheritance.html
Dcaptain at 2007-7-6 20:11:20 > top of Java-index,Java Essentials,Java Programming...
# 4

> Why does the java language not support inheritance?

Java has its own flavour of multiple inheritance. I has single inheritance of implementation and multiple inheritance of interfaces. This avoids the "diamond" problem associated with multiple inheritance of implementation and it forces the Java programmer not to use inheritance for the wrong reason. Inheritance should be used only if there's an IS-A relationship between the subclasses and the superclass, not just as a convinient way to add on code to a class.

UlrikaJ at 2007-7-6 20:11:20 > top of Java-index,Java Essentials,Java Programming...
# 5
please give me answare.
kunal_in at 2007-7-6 20:11:20 > top of Java-index,Java Essentials,Java Programming...
# 6

Because it is heracy.

On a more serious note look up any paper on the theory of Object Oriented Programming Languages and you will quickly see that multiple inheritance is not pure OOP. It ca save some time possibly in very isolated incidents but you should be able to create a more robust, secure solution following true OOP structures.

wrconkling at 2007-7-6 20:11:20 > top of Java-index,Java Essentials,Java Programming...
# 7
> please give me answare.What's wrong with the answers already given?
jverd at 2007-7-6 20:11:20 > top of Java-index,Java Essentials,Java Programming...
# 8
> please give me answare.Yes, for almost two years after this thread died we demand answare!kind regards,Jos ( I'd like to call for a revolt ;-)
JosAH at 2007-7-6 20:11:20 > top of Java-index,Java Essentials,Java Programming...
# 9

The reasons for omitting multiple inheritance from the Java language mostly stem from the "simple, object oriented, and familiar" goal. As a simple language, Java's creators wanted a language that most developers could grasp without extensive training. To that end, they worked to make the language as similar to C++ as possible (familiar) without carrying over C++'s unnecessary complexity (simple).

In the designers' opinion, multiple inheritance causes more problems and confusion than it solves. So they cut multiple inheritance from the language (just as they cut operator overloading). The designers' extensive C++ experience taught them that multiple inheritance just wasn't worth the headache.

Java_Ashok at 2007-7-6 20:11:20 > top of Java-index,Java Essentials,Java Programming...