Question OOP-SOLID-0010
MediumSquare extends Rectangle, but setting a Square's width also changes its height, surprising code written for rectangles. Which principle does this break?
- A.
Open/Closed
- B.
Single Responsibility
- C.
Sign up free to see the answer and a step-by-step explanation.