In Java, dynamic method invocation means that an eligible instance-method call can run an overridden implementation chosen at runtime from the target object’s actual class. Compile-time resolution first determines which method signature the call refers to; runtime dispatch then selects the matching implementation. This is the core of polymorphic method calls—not a rule that Java reselects among every overload based on the object’s runtime type.
How dynamic method dispatch works in Java
Consider a variable declared as a superclass or interface type that refers to an object of a subclass. When the variable calls an instance method that the subclass overrides, the call can execute the subclass implementation. The declared type helps determine which method invocation is valid and which method descriptor is resolved; the object’s runtime class guides the subsequent lookup for an applicable overridden implementation.
As an Amazon Associate I earn from qualifying purchases.
The Java Language Specification describes method invocation as involving compile-time resolution and, for relevant invocation modes, runtime lookup. For an ordinary virtual or interface call, lookup starts from the target object’s actual runtime class. The specification also notes that this behavior need not appear as a repeated search: implementations may use per-class dispatch tables or other structures to provide the specified result. Oracle’s Java SE 20 Language Specification, Chapter 15 defines the language behavior.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitchesA small example
class Animal {
void speak() { System.out.println("Animal"); }
}
class Dog extends Animal {
@Override
void speak() { System.out.println("Dog"); }
}
Animal pet = new Dog();
pet.speak();
The reference is declared as Animal, but it refers to a Dog. Since Dog overrides the instance method speak(), this call can use the Dog implementation. The example illustrates the distinction between the reference’s compile-time type and the object’s runtime class; it does not mean every aspect of the call is postponed until runtime. The National University of Singapore’s method-invocation lesson explains the method descriptor and implementation lookup as separate decisions.
Dynamic dispatch is not overload resolution
Overloading and overriding describe different decisions. With overloaded methods, Java resolves which signature a call refers to using compile-time information, including the declared types and argument types. With an eligible overridden instance method, runtime dispatch can choose which class implementation of that resolved method runs.
For example, a class may define both print(Object) and print(String). Which overload a call selects is determined during compile-time resolution, not by rechecking the receiver’s runtime class and choosing a different overload. If the selected signature is an overridable instance method, the implementation for that signature can still be chosen through runtime dispatch.
Rank #2
- Overloading: selects a method signature during compile-time resolution.
- Overriding: lets a subclass provide an implementation that may be selected for an eligible instance call at runtime.
Which Java calls use this mechanism?
Dynamic method lookup is especially useful for understanding polymorphic calls to overridden instance methods. It does not describe every Java method call in the same way.
Free tools Windows power users keep installed
One-click scans. No signup required.
- Instance calls: Applicable virtual and interface invocations can use runtime lookup to select an overriding implementation.
- Static methods: They are not overridden through ordinary instance-method dispatch. Do not treat a static call as a polymorphic instance call.
supercalls: These use a distinct invocation mode and lookup starting point. They should not be explained as ordinary virtual calls that simply begin lookup at the target object’s runtime class.
The precise rules and invocation modes are specified in Java SE 20’s method-invocation rules.
How reflection relates to dynamic invocation
Reflection is an API for invoking a method represented by a Method object; it is not another name for dynamic dispatch. For an instance method, however, invoking through reflection does not necessarily bypass overriding: the implementation corresponding to the target object’s runtime type can still be used. Android’s Method API reference documents this behavior.
That distinction is useful when reading code: reflection describes how the program identifies and invokes a method through an API, while dynamic dispatch describes how an eligible instance invocation reaches an implementation. Reflection’s presence alone does not define the dispatch behavior.
Rank #4
Why the phrase can mean something else
In distributed-systems writing, “dynamic method invocation” may refer to a client requesting a service by describing what it needs without knowing the specific object identifier or class that will provide it. At runtime, the system can discover a suitable service implementation and route the request. In that usage, lookup happens across a service registry or repository rather than through Java’s class-based method dispatch. A ScienceDirect Topics entry drawing on Richard John Anthony’s 2016 Systems Programming presents this separate systems-programming sense.
So the surrounding context matters: in Java language discussions, the phrase usually concerns runtime selection of an overridden instance implementation; in distributed systems, it can describe runtime discovery and routing to a service.
Quick Recap
Best Value
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




