Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

what is dynamic method dispatch ?

Answer Posted / hasib reza

Determining at runtime, which overridden method to call, is called dynamic method dispatch.
 This is how Java implements run-time polymorphism.
Whenever a method is called on an object reference,
 Declared type of object reference is checked at compile time to make sure the method exists in declared class.
At run time, the super class objects reference could refer to an instance of any subclass of the declared reference type.
When an overridden method is called through a super class reference,
 Java determines which version of that method to execute based upon the type of object being referred.
When different types of objects are referred to,
 Different versions of an overridden method will be called.
It is the type of the object being referred to
 Not the type of the reference variable

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can a class extend 2 classes in java?

1093


Define how destructors are defined in java?

1075


What is a stringbuilder?

975


How can a gui component handle its own events in java programming?

1082


What is the argument in java?

988


What is an immutable class? How to create an immutable class?

1115


Can we sort array in java?

1011


Difference difference paint() and paintcomponent()?

1049


Write a program in java to create a doubly linked list containing n nodes.

1022


Why do we need hashset in java?

1094


What is use of a abstract variable?

1049


Explain the use of javap tool.

1184


What are the advantages of exception handling in java?

1099


What is an interface in java?

1088


Explain the importance of import keyword in java?

1060