+ 3
Why java doesn't support multiple inheritance?
9 odpowiedzi
+ 1
it supports multiple inheritance but not from classes !! you can extends from one class but you can implements any number of interfaces
+ 1
consider it extends two classes and both have same method name..then there would be ambiguity
0
java support multiple inheritance,.. as long as i learn
0
It is just to remove ambiguity, because multiple inheritance can cause ambiguity in few scenarios.
0
it supports multiple inheritance
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
0
like u said it's can't implements 😑 by implementing it's inherent the methods too but u need to implement them!
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.
- 1
have you learn about OOP? i think there are multiple inheritance, although a little used, -_-