Liskov Substitution Principle
The Liskov Substitution Principle (LSP) is a design principle in object-oriented programming (OOP).
It states that, in a well-designed class hierarchy, objects of a superclass can be substituted for things of any of its subclasses without affecting the correctness of the program.
In other words, if S is a subtype of T, then objects of type S should be substitutable for things of type T in all contexts. This means that any code with an object of type T should also work with an object of type S.
The LSP is important because it helps to ensure that code is robust and maintainable. The LSP makes extending, and modifying code without introducing errors easier by providing that subtypes are substitutable for their supertypes.





