• Post Reply Bookmark Topic Watch Topic
  • New Topic

Dyanmic method dispatch  RSS feed

 
Sundaralingam Subramaniyan
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
what is Dynamic Method Dispatch?
Explain me about this Java feature.
thanks
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's probably talking about the runtime decision made by the JVM in polymorphic designs.

When we compile this method, the compiler cannot bind the size() call to a particular class and method at compile time, because it can't know what kind of List might be passed in at run time. At run time the JVM looks up the size() method of the object passed in. The JVM might find the method on the class of the object passed in, or maybe on some super class.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!