aspose file tools*
The moose likes Beginning Java and the fly likes Dynamic dispatch?????? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Dynamic dispatch??????" Watch "Dynamic dispatch??????" New topic
Author

Dynamic dispatch??????

Niyas Ahmed Sheikh
Ranch Hand

Joined: Jun 15, 2005
Posts: 129
What is Dynamic Dispatch in Java?
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3742
    
  16
Do you understand what dynamic dispatch is and just want to know how to implement it in Java, or do you want to know what dynamic dispatch is ?


Joanne
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Google is your friend. Search for "Dynamic Dispatch". I tried to paste the resulting URL in here but it turned into emoticons instead of a url.

The WikiPedia is pretty amazing, but their article on dynamic dispatch doesn't have Java!
[ October 03, 2005: Message edited by: Stan James ]

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Naveen Vooka
Greenhorn

Joined: Oct 13, 2004
Posts: 25
http://www.objectfaq.com/oofaq2/DynamicDispatch.htm
http://www.objectfaq.com/oofaq2/DynInh.htm

--------------
Naveen Vooka
www.devsquare.com
DevSquare - Online Application Development
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
I think those links are trying to sell you something ... a framework that makes Java simulate multiple inheritance. They rendered so poorly on Firefox that I didn't try very hard to figure it out.

Dynamic dispatch is the fundamental language feature that enables runtime polymorphism. When I code a method call on a variable declared as an interface there is no code present at compile time to be called. At runtime the JVM routes the call to the actual class of the object referenced by the variable.

List books = getBooks();
System.out.println(books.size());

List promises that a method size() exists but doesn't implement it. Some concrete class like LinkedList implements it and the JVM does "dynamic dispatch" to the concrete method.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dynamic dispatch??????