← 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?
- A.Single Responsibility
- B.Liskov Substitution
- C.Open/Closed
- 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 →