0
Why not supported multiple inheritance in java
2 ответов
+ 1
class A {
display();
}
class B {
display();
}
class C extends A,B {
}
main (){
C obj = new C();
obj.display();
}
In the above program which display method is executed? Confusing right? Just in order to remove this ambiguity Java doesn't support multiple inheritance using Classes.
But you can always do multiple inheritance using interfaces in Java.
Kindly ignore the syntax, it is just for understanding purpose.
0
Thanks bro