Why Java Doesn't Support Multiple Inheritance

Possible duplicate:
Why there is no multiple inheritance in Java, but multiple interfaces are allowed

Hi everyone, I am new to java, and when I try to use the multiple concept of inheritance in java, it shows a compile-time error. Why java does not support it. I heard about the interface keyword, but I don't know why Java supports it directly. please help me with this and explain.

+5
source share
3 answers

Multiple inheritance can be very difficult to understand. When you have multiple inheritance with two classes that have methods in conflict, how do you deal with this?

, (, ++), Java , Java ( ).

sun.com:

- - Java. , Objective C. . , , . , . .


:

+15

( ) .

:

- , B C A, D B C. D , ( ), B C , : B C?

+21

Because it was hard to use it. Instead, Java has interfacewhat is much better.

+1
source

All Articles