Liskov Substitution Principle — a practical guide to LSP SOLID with clear examples you can reuse in real projects.
OOP Tutorial Series (49/65). Prefer one article? Read the complete OOP tutorial.
Short description
If code expects a `Bird`, a subclass should not surprise it (e.g., by throwing on `fly()` when flying was assumed).
LSP tip
Subtypes must honor parent contracts
Don't strengthen preconditions unexpectedly
Prefer separate interfaces when behaviors diverge