What is dynamic dispatch in Java?
- Polymorphism - descendant classes can define their own routines to implement functions in a base class
- More info
- http://en.wikipedia.org/wiki/Dynamic_dispatch
- A case of dynamic dispatching
- Dynamic dispatching is what makes polymorphic behavior happen. When you call toString() on an object, the right implementation is called because Java dispatches to the appropriate method based on the type of the instance. But Java doesn’t go the whole length when it comes to dynamic dispatch: while it pays attention to the actual type of the instance, it only concerns itself with the type of the reference to any parameters, not their actual types
- Constructors and polymorphism in java doing suprising things - http://www.java2s.com/Tutorial/Java/0100__Class-Definition/Constructorsandpolymorphismdontproducewhatyoumightexpect.htm
- Runtime polymorphism - dynamic method dispatch link
- Call to a method is resolved and runtime instead of compile time.
- Problem with java dynamic dispatch
- Mentions java reflection API's
- More info
Labels:
None
Add Comment