Inheritance

Inheritance lets a class (child) take on the fields and methods of another (parent) with extends, and specialize them by overriding methods (@Override). A class inherits from only one class. super accesses the parent. Inheritance expresses an "is a" relationship.

Example

class Chien extends Animal {
    @Override
    String crier() { return "Woof"; }
}

Related concepts

The whole glossary