0
Why Java doesn't support Multiple inheritance, tuple, and operator overloading.
5 Antworten
+ 11
Java doesn't support multiple inheritance of a classes to avoid ambiguity, when the methods signatures of the inherited classes match
+ 6
Multiple inheritance is likely not supported because of the Diamond Problem. This problem occurs if you have a sub class inheriting 2 classes that each inherit some base class. The 2 classes both override the same method from the base class. Now you call the overrided method from the bottom class. Which method will run out of the 2 inherited classes? Idk. That's the problem with multiple inheritance, which is a potential reason why Java decided to avoid it.
+ 3
thats just how java was designed.
at least you can implement more than one interface
+ 1
@Alexy thanks
0
Yup, it does support multiple interfaces, but there has to be some architectural reason. Why they designed it like that. Just curiosity!!