Which design principle suggests that objects should be open for extension but closed for modification?

  • Abstraction
  • Inheritance
  • Open-Closed Principle
  • Polymorphism
The 'Open-Closed Principle' is a fundamental design principle in object-oriented programming. It suggests that software entities (such as classes) should be open for extension (new functionality can be added) but closed for modification (existing code remains unchanged). This encourages modularity and maintainability.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *