# Inheritance

Letting a class reuse and extend the data and methods of another class.

## What is **Inheritance**?

**Inheritance** lets one class build on another. The new class gets all the data and methods of the existing class and can add or change some. A `Cat` class can inherit from `Animal` and add a `Purr` method.

```csharp
public class Animal
{
    public string Name { get; set; }
    public void Eat() => Console.WriteLine($"{Name} is eating");
}

public class Cat : Animal
{
    public void Purr() => Console.WriteLine("Purrr");
}
```

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

Updated: September 27, 2026

## In other subjects

- [Inheritance in C#](https://www.ask-codey.com/glossary/inheritance-c-sharp)
- [Inheritance in CSS](https://www.ask-codey.com/glossary/inheritance-css)
- [Inheritance in Java](https://www.ask-codey.com/glossary/inheritance-java)
- [Inheritance in JavaScript](https://www.ask-codey.com/glossary/inheritance-javascript)

Source: https://www.ask-codey.com/glossary/inheritance-oop
