Mock Exam Task 2c)

For Task 2 Subtask c, shouldn’t the last option “Subclasses should not demand more, and not provide less.” also be true? This is exactly what is stated in the Liskov Substitution Principle (“Derived methods should expect not more and deliver not less.”). Am I understanding something wrong, or is the solution just wrong?

Hello,
your understanding of the Liskov Substitution Principle is correct. The question just asked about the “open-closed principle“.

1 Like