🎙 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 8 of 10

A subclass overrides an inherited method only to throw "operation not supported". Which principle is likely violated?

A subclass overrides an inherited method only to throw "operation not supported". Which principle is likely violated?

  1. A.Single Responsibility
  2. B.Liskov Substitution
  3. C.Open/Closed
  4. D.Interface Segregation only if it has fields
Answer & explanation

Correct answer: Liskov Substitution

Callers using the parent type are surprised; the child cannot replace the parent.

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 →