Dynamic Dispatch

Choosing an overridden instance method at runtime from the object's actual class.

What is Dynamic Dispatch in Java?

Dynamic Dispatch — Choosing an overridden instance method at runtime from the object's actual class.

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