#6.3 Java Tutorial | Multiple Inheritance in Java?

Published: 03 February 2018
on channel: Telusko
82,284
899

In this lecture we are discussing:
1)what is multiple inheritance?
2)Why Java does not support Multiple Inheritance?
3)What is ambiguity and not allowed in java?

#1
Multiple inheritance
If a particular class inheriting multiple class then this type of inheritance is called multiple inheritance.
like c++ language there are multiple inheritance like that :
class A
{
... .. ...
};
class B
{
... .. ...
};
class C: public A,public B
{
... ... ...
};

But Java not allowed we have alternate option for that is implementing multiple interface not we will discussing in upcoming lecture.
#2
why java not support multiple inheritance?
:- Because of the Ambiguity problem, Java does not support multiple inheritances directly.

#3
Why it is ambiguous?
suppose we have some class A, B and c
class A
{
... .. ...
show(){

}
};
class B
{
... .. ...
show(){

}
};
class C extends A,B //assume for some instance java support multiple inheritence
{
... ... ...
show();
//here we get ambiguity since if we allowed multiple inheritance and same two property or method belong to class A and Class B
//then how C class use show() method there is ambiguity of choice...
//that’s why java exclude the concept of multiple inheritance

};

Instagram :   / navinreddyofficial  
Linkedin :   / navinreddy20  
Discord :   / discord  

More Learning :

Java - https://bit.ly/3xleOA2
Python :- https://bit.ly/3H0DYHx
Django :- https://bit.ly/3awMaD8
Spring Boot :- https://bit.ly/3aucCgB
Spring Framework :- https://bit.ly/3GRfxwe

Servlet & JSP :- https://bit.ly/3mh5CGz
Hibernate Tutorial :- https://bit.ly/3NWAKah
Rest API | Web Service Tutorial :- https://bit.ly/38RJCiy

Git :- https://bit.ly/3NUHB3V
JavaScript :- https://bit.ly/3mkcFys
Kotlin :- https://bit.ly/3GR2DOG


Donation:
PayPal Id : navinreddy20
Patreon : navinreddy20
http://www.telusko.com/contactus


On this page of the site you can watch the video online #6.3 Java Tutorial | Multiple Inheritance in Java? with a duration of hours minute second in good quality, which was uploaded by the user Telusko 03 February 2018, share the link with friends and acquaintances, this video has already been watched 82,284 times on youtube and it was liked by 899 viewers. Enjoy your viewing!