+ 1
Wants to know that why we are not use multiple inheritance in java ?
4 odpowiedzi
+ 1
multiple inheritance means,,many base class and one derived class,suppose class A and B are base class for class D,which is inheriting properties of class A and B,now if both class A and B are having a method of same name,then while caling derive class object,compiler gets confuced,this is called ambiguity of multiple inheritance.so we dont use this in java
0
but why we can't use it is their any reason behind it. ?
0
Multiple Inheritance comes with a problem, commonly known as 'Deadly Diamond of Death'.
That's why it is not supported in Java.
- 1
multiple inheritance is not directly used in Java but can be implemented indirectly by using the concept of interfaces.