# Inheritance

Creating a class that receives accessible members from another class.

## What is **Inheritance** in Java?

**Inheritance** — Creating a class that receives accessible members from another class.

```java
class Alert {
    String text() {
        return "Alert";
    }
}

class EmailAlert extends Alert {
    @Override
    String text() {
        return "Email";
    }
}
```

Level: Journeyman · [More Java terms at this level](https://www.ask-codey.com/glossary/subjects/java/journeyman)

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 JavaScript](https://www.ask-codey.com/glossary/inheritance-javascript)
- [Inheritance in OOP](https://www.ask-codey.com/glossary/inheritance-oop)

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