Check out our courses:
Enterprise Java Spring Microservices: [ Ссылка ]
Coupon: TELUSKO10 (10% Discount)
Master Java Spring Development : [ Ссылка ]
Coupon: TELUSKO20 (20% Discount)
Udemy Courses:
Java:- [ Ссылка ]
Spring:- [ Ссылка ]
Java For Programmers:- [ Ссылка ]
For More Queries WhatsApp or Call on : +919008963671
website : [ Ссылка ]
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
};
Github repo : [ Ссылка ]
Java:- [ Ссылка ]
Spring:- [ Ссылка ]
More Learning :
Java :- [ Ссылка ]
Python :- [ Ссылка ]
Django :- [ Ссылка ]
JavaScript :- [ Ссылка ]
Node JS :- [ Ссылка ]
Rest Api :-[ Ссылка ]
Servlet :- [ Ссылка ]
Spring Framework :- [ Ссылка ]
Design Patterns in Java :- [ Ссылка ]
Docker :- [ Ссылка ]
Blockchain Tutorial :- [ Ссылка ]
Corda Tutorial:- [ Ссылка ]
Hyperledger Fabric :- [ Ссылка ]
NoSQL Tutorial :- [ Ссылка ]
Mysql Tutorial :- [ Ссылка ]
Data Structures using Java :- [ Ссылка ]
Git Tutorial :- [ Ссылка ]
Donation:
PayPal Id : navinreddy20
[ Ссылка ]
![](https://s2.save4k.ru/pic/NTN8lO6yeqw/maxresdefault.jpg)