#6.3 Java Tutorial | Multiple Inheritance in Java?

Опубликовано: 03 Февраль 2018
на канале: 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


На этой странице сайта вы можете посмотреть видео онлайн #6.3 Java Tutorial | Multiple Inheritance in Java? длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Telusko 03 Февраль 2018, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 82,284 раз и оно понравилось 899 зрителям. Приятного просмотра!