Why not supported multiple inheritance in java | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

Why not supported multiple inheritance in java

7th Nov 2019, 4:03 PM
akash raut
2 Respuestas
+ 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.
7th Nov 2019, 4:16 PM
Avinesh
Avinesh - avatar
0
Thanks bro
9th Nov 2019, 4:09 PM
akash raut