🎉 October Learning Month — learn a new software term every day!
An interactive flashcard trainer for software engineering terms.

Liskov Substitution

In plain terms

Subtypes must be usable wherever their base type is expected.

Going deeper

The Liskov Substitution Principle states that objects of a subclass should be substitutable for their parent without breaking behavior. Subtypes must honor the contract.

Under the hood

The 'L' in SOLID; violations (e.g., a square subclassing rectangle) cause surprising bugs.

Examples

SOLID, inheritance correctness, polymorphism, substitutability, contracts.

Think of it like...

Like any certified replacement part fitting and working where the original did.

Feedback & Bug Report