Polymorphism

Using one declared type to work with objects that provide different implementations.

What is Polymorphism in Java?

Polymorphism — Using one declared type to work with objects that provide different implementations.

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

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

Level: Journeyman · More Java terms at this level

Updated

In other subjects