SOLID Violation
You have a Shape class with a draw() method and an if-else chain that checks the shape type (circle, rectangle, triangle) to decide how to draw it. Adding a new shape requires modifying this method. Which principle is violated, and what is the standard fix?
Sign in to answer questions and track your progress
Sign In