why java does not support multiple inheritance
Answer Posted / sreekanta paul
In C++ when a subclass inherits a superclass then the name of superclass is specified.But in java it is quite confusing from which superclass a method will be inherited by the subclass.Suppose wo classes B and C inherit from A, and class D inherits from both B and C. If a method in D calls a method defined in A (and does not override the method), and B and C have overridden that method differently, then from which class does it inherit: B, or C?
Thats why in java the concept of Interface came to solve this problem.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How will you reverse a link list without using recursion?
What do you mean by Hash Map and Hash Table?
Explain garbage collection in java?
How many types of operators are there?
What is a marker interface?
What mechanism does java use for memory management?
what is the difference between yielding and sleeping? : Java thread
What is data type in computer?
What are identifiers in java?
What is thread synchronization in java?
What is javac in java?
Can we define constructor in inner class?
What is meant by string is immutable?
What are the three types of design patterns?
What is complexity and its types?