Question OOP-INH-0067
HardA class Square extends Rectangle and overrides setWidth to also change the height. Code that sets width 4 and height 5 then expects area 20 gets 25. Which principle is broken?
- A.
Liskov Substitution
- B.
Open/Closed
- C.
Sign up free to see the answer and a step-by-step explanation.