📞 0339-0387701 (WhatsApp) Contact

« Back to Software Engineering (NCCIA)

Which SOLID principle requires that objects of a subclass can replace objects of a superclass without breaking the program?

A. Open-Closed Principle
B. Interface Segregation Principle
C. Dependency Inversion Principle
D. Liskov Substitution Principle ✅

Correct Answer: D. Liskov Substitution Principle

Explanation

  • Liskov Substitution Principle guarantees substitutability
  • A subclass must honour the superclass contract.