Question

When should you use inheritance over composition?

A When you want to reuse code without establishing an "is-a" relationship.
B When the relationship between classes is "has-a".
C When the subclass is a specialized type of the superclass ("is-a" relationship).
D When you need to achieve multiple inheritance of implementation.
E When you want to avoid polymorphism.
Practice Next

Hey! Ask a query

🎓
Think You're Ready for RBI Grade B?
RBI Grade B 2026 Phase 1 Memory Based Paper
  • 200 Questions with Detailed Solutions
  • Section-wise Coverage (GA, English, Quant & Reasoning)