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 casting in java programming?
Can a class extends itself in java?
How to display all the prime numbers between 1 and 100
What are thread local variables?
Explain different ways of creating a thread. Which one would you prefer and why?
What does the three dot emoji mean?
What is the benefit of inner classes in java?
What does flagged out mean?
Where is the find and replace?
Is main an identifier?
What’s meant by anonymous class?
What is meant by 'Class access modifiers'?
What is the properties class in java programming?
How do you override a variable in java?
How many static init can you have?