Child Classes should be replaceable with Parent Classes without breaking the behavior of our code.
Substitutability is a principle in object-oriented programming stating that, in a computer program, if S is a subtype of T, then objects of type T may be replaced with objects of type S
Bad Implementation :
publicclassBird{publicvoidfly(){}}publicclassDuckextendsBird{}// The duck can fly because it is a bird, but what about this:publicclassOstrichextendsBird{}// Ostrich is a bird, but it can't fly, Ostrich class is a subtype of class Bird, but it shouldn't be able to use the fly method, that means we are breaking the LSP principle.