Bird
Raised Fist0

When architecting a large system, what is the primary limitation of using abstract classes instead of interfaces in terms of system extensibility?

medium💡 Conceptual Thinking Q5 of Q15
OOP & Design Patterns - Abstraction - Abstract Class vs Interface - When to Use Which
When architecting a large system, what is the primary limitation of using abstract classes instead of interfaces in terms of system extensibility?
AAbstract classes cannot contain any implemented methods.
BAbstract classes restrict multiple inheritance, reducing flexibility.
CAbstract classes allow only static methods, limiting dynamic behavior.
DAbstract classes enforce implementation of all methods immediately.
Step-by-Step Solution
Solution:
  1. Step 1: Understand abstract class constraints

    Abstract classes support single inheritance only.
  2. Step 2: Impact on extensibility

    Single inheritance limits ability to extend multiple behaviors, reducing flexibility.
  3. Final Answer:

    Option B -> Option B
  4. Quick Check:

    Abstract classes limit inheritance, interfaces allow multiple [OK]
Quick Trick: Abstract classes limit inheritance to one parent [OK]
Common Mistakes:
MISTAKES
  • Believing abstract classes cannot have implemented methods
  • Confusing static method allowance with abstraction
  • Assuming all methods must be implemented immediately
Trap Explanation:
PITFALL
  • Incorrectly thinking abstract classes cannot have implemented methods or static methods.
Interviewer Note:
CONTEXT
  • Evaluates knowledge of inheritance limitations affecting system design.
Master "Abstraction - Abstract Class vs Interface - When to Use Which" in OOP & Design Patterns

2 interactive learning modes - each teaches the same concept differently

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More OOP & Design Patterns Quizzes