Question OOP-SOLID-0042
MediumA Shape area calculator uses if (type == "circle") … else if (type == "square") …, and every new shape needs this code edited. Which principle does a Shape interface with area() satisfy instead?
- A.
Single Responsibility only
- B.
Liskov Substitution
- C.
Sign up free to see the answer and a step-by-step explanation.