# Liskov Substitution Principle

A child class must work anywhere its parent class is expected, without surprises.

## What is **Liskov Substitution Principle**?

The **Liskov Substitution Principle** says a child class must work anywhere its parent is expected, without surprises. If code works with a `Bird`, it must still work when handed any kind of bird.

```csharp
// Breaks the rule: code that calls bird.Fly() crashes for penguins
public class Penguin : Bird
{
    public override void Fly() => throw new NotSupportedException();
}
```

Level: Freelancer · [More OOP terms at this level](https://www.ask-codey.com/glossary/subjects/oop/freelancer)

Updated: September 27, 2026

Source: https://www.ask-codey.com/glossary/liskov-substitution-principle
