Liskov Substitution Principle
LSP states that objects of a subtype should be usable wherever objects of the base type are expected without violating the correctness assumptions of the client. The classic Square/Rectangle example demonstrates the problem: mathematically a square is a rectangle, but if Rectangle exposes independently mutable width and height, a Square cannot honor that behavioral contract. The issue is not inheritance syntax; it is incompatible behavioral expectations.
LSP is about behavioral substitutability.
A subtype must preserve the base type's meaningful guarantees.
Violations often produce surprising conditionals, exceptions or incorrect results.
The Square/Rectangle issue is caused by incompatible mutation contracts.
Composition or separate abstractions can model the domain more safely.