Differences between Dynamic Dispatch and Dynamic Binding
- by Prog
I've been looking on Google for a clear diffrentiation with examples but couldn't find any.
I'm trying to understand the differences between Dynamic Dispatch and Dynamic Binding in Object Oriented languages.
As far as I understand, Dynamic Dispatch is what happens when the concrete method invoked is decided at runtime, based on the concrete type.
For example:
public void doStuff(SuperType object){
object.act();
}
SuperType has several subclasses. The concrete class of the object will only be known at runtime, and so the concrete act() implementation invoked will be decided at runtime.
However, I'm not sure what Dynamic Binding means, and how it differs from Dynamic Dispatch.
Please explain Dynamic Binding and how it's different from Dynamic Dispatch. Java examples would be welcome.