Why java doesn't support multiple inheritance? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Why java doesn't support multiple inheritance?

8th Nov 2016, 12:39 AM
Raghunath S
Raghunath S - avatar
9 Answers
+ 1
it supports multiple inheritance but not from classes !! you can extends from one class but you can implements any number of interfaces
23rd Nov 2016, 1:14 AM
Mohammed Fakham
Mohammed Fakham - avatar
+ 1
consider it extends two classes and both have same method name..then there would be ambiguity
23rd Nov 2016, 3:46 AM
Somnath Ghosh
Somnath Ghosh - avatar
0
java support multiple inheritance,.. as long as i learn
8th Nov 2016, 12:50 AM
Mafmudin (ig:tw:: @mafmudin)
Mafmudin (ig:tw:: @mafmudin) - avatar
0
It is just to remove ambiguity, because multiple inheritance can cause ambiguity in few scenarios.
8th Nov 2016, 1:07 AM
Raghunath S
Raghunath S - avatar
0
it supports multiple inheritance
11th Nov 2016, 6:07 PM
savitha R
savitha R - avatar
0
C++ , Common lisp and few other languages supports multiple inheritance while javadoesn't support it. It is just to remove ambiguity, because multiple inheritance can cause ambiguity in few scenarios. One of the most common scenario is Diamond problem
12th Nov 2016, 1:30 AM
Raghunath S
Raghunath S - avatar
0
like u said it's can't implements 😑 by implementing it's inherent the methods too but u need to implement them!
23rd Nov 2016, 12:37 PM
Mohammed Fakham
Mohammed Fakham - avatar
0
Java streamlines inheritance by utilizing a cumulative inheritance model. For example, if I begin with a single class and then I extend that class into each subsequent class that I create based on the master class, I will have created a single class that has in fact inherited multiple classes. E.g. Create class animal then new class mammal inherits animal, new class primate inherits from mammal which contains properties of animal, new class homo sapien then inherits from class primate which contains properties of animal, mammal, and primate. this goes so on and so forth. many of the libraries available in Java are built up from these cumulative inheritances.
26th Dec 2016, 1:30 AM
Bernard
- 1
have you learn about OOP? i think there are multiple inheritance, although a little used, -_-
8th Nov 2016, 1:10 AM
Mafmudin (ig:tw:: @mafmudin)
Mafmudin (ig:tw:: @mafmudin) - avatar