Liskovsubstitution
The Liskov Substitution Principle (LSP) is one of the five fundamental principles of object-oriented design, introduced by computer scientist Barbara Liskov in 1987. It is a cornerstone of the SOLID principles, which aim to make software designs more maintainable, flexible, and robust. LSP states that objects of a superclass should be replaceable with objects of its subclasses without breaking the application. In other words, if a program expects an object of type *Base*, it should work correctly with any object of type *Derived*, where *Derived* is a subclass of *Base*.
The principle emphasizes that inheritance should not introduce unexpected behavior. A subclass should adhere to the
LSP is particularly relevant in polymorphism, where objects of different classes are treated uniformly through a
Failure to adhere to LSP often results in fragile base class problems, where changes to a parent