+ 5
 Why multiple inheritance is not supported in java?
3 RĂ©ponses
+ 3
if I'm not mistaken, it's possible to do everything that is done with multiple inheritance using the interfaces.
+ 3
Java doesnât allow multiple inheritance to avoid the ambiguity caused by it. Suppose there are four classes A, B, C and D. Class B extends class A as well as class C extends class A. Class D extends both classes B & C. Now lets assume we have a method in class A and class B & C overrides that method in their own way. Here the problem comes â Because D is extending both B & C so if D wants to use the same method which method would be called (the overridden method of B or the overridden method of C). Ambiguity. Thatâs the main reason why Java doesnât support multiple inheritance.
0
I don't know that much about it but I think it is because it could lead to bugs and owerwrites of methods