← Quiz: SOLID Principles: all 10 questions
Quiz: SOLID Principles · Question 3 of 10
A Square subclass that breaks code written for Rectangle violates:
A Square subclass that breaks code written for Rectangle violates:
- A.Open/Closed
- B.Liskov Substitution
- C.Interface Segregation
- D.Single Responsibility
Answer & explanation
Correct answer: Liskov Substitution
A subclass must be usable wherever the parent is, without changing expected behaviour.
Can you get the rest right without peeking?
Take the timed Quiz: SOLID Principles quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →