Which principle advocates that a class should have only one reason to change?

  • Single Responsibility Principle (SRP)
  • Open/Closed Principle (OCP)
  • Liskov Substitution Principle (LSP)
  • Interface Segregation Principle (ISP)
The Single Responsibility Principle (SRP) suggests that a class should have only one reason to change, meaning it should have a single, well-defined responsibility. This principle contributes to code maintainability and flexibility.
Add your answer
Loading...

Leave a comment

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