Why JAVA does not support multiple inheritance ?
Plz explain .
HonFu You are are correct that multiple inheritance is a nightmare to maintain due to ambiguity from name collisions in base members, resulting in the "deadly diamond of death" problem. https://en.m.wikipedia.org/wiki/Multiple_inheritance#The_diamond_problem
I'd say it's a design decision to make things less bug-likely. When you inherit from several classes and for example they have the same method names, from where will the kid inherit, mommy or daddy? Issues like that. Other languages let you do it and trust you handle things right. That makes some things easier and other things (debugging) potentially harder. I'm still quite confused myself even by basic OOP, so I'm looking forward to any 'deeper' answer you may still get.
It is mainly because to avoid conflicts between methods and variables. Suppose if you have 2 classes and methods with same name exist in both classes jre has to stop and think what to execute. To avoid this java does not support multiple inheritance.
Genghis, I share that feeling... but what has that got to do with this question?
Genghis, I still don't see where's the relation to the question why Java doesn't have multiple inheritance.
HonFu ive thought long and hard, and the relevance is I think its because Java actually is an enterprise hardened language. Its a clever one.
HonFu I am python and only python, but the more I learn the more I wish I learned a statically typed language first
sizeof funtion with a loop in c!
1. Write a program that asks the user for their name and how many times to print it. The program should print out the user’s nam
What does % mean