Abstract classes

An abstract class, declared with abstract, cannot be instantiated and serves as a common base. It can contain abstract methods, with no body, that child classes must implement, as well as shared code and fields. It suits cases where child classes share state and behavior.

Example

abstract class Forme {
    abstract double aire();
}

Related concepts

The whole glossary