The open-closed principle (OCP) states that software entities should be open for extension, but closed for modification; that is, such an entity can allow its behaviour to be extended without modifying its source code.
In simple terms: You should be able to add new features to your code without changing or breaking the existing code.
Importance:
Extensibility: New features can be added without modifying existing code.
Stability: Reduces the risk of introducing bugs when making changes.






