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
What is jit compiler in java?
What is increment in java?
Why stringbuilder is not thread safe?
What is lambda in java?
Why we cannot override static method?
When can you say a graph to be a tree?
What is contractor means and methods?
What is a platform?
What is difference between path and classpath in java?
Why packages are used?
What methodology can be utilized to link to a database?
'A class is a template for an object' explain this statement.
What do you mean by pointer value and address?
What is hashing in java?
How can we make copy of a java object?