Bird
0
0

Why does Java use interfaces instead of allowing multiple inheritance of classes?

hard📝 Conceptual Q10 of 15
Java - Interfaces
Why does Java use interfaces instead of allowing multiple inheritance of classes?
ABecause interfaces can be instantiated directly
BBecause interfaces can store state while classes cannot
CTo force all classes to be abstract
DTo avoid ambiguity and complexity from multiple class inheritance
Step-by-Step Solution
Solution:
  1. Step 1: Understand multiple inheritance issues

    Multiple class inheritance can cause ambiguity and complexity in method resolution.
  2. Step 2: Role of interfaces

    Interfaces provide multiple inheritance of method signatures without state, avoiding these problems.
  3. Final Answer:

    To avoid ambiguity and complexity from multiple class inheritance -> Option D
  4. Quick Check:

    Interfaces prevent multiple inheritance issues [OK]
Quick Trick: Interfaces avoid multiple inheritance problems [OK]
Common Mistakes:
  • Thinking interfaces store state
  • Believing interfaces force abstract classes
  • Assuming interfaces can be instantiated

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Java Quizzes