🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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:

  1. A.Open/Closed
  2. B.Liskov Substitution
  3. C.Interface Segregation
  4. 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 →