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

What is a parameter in java?

992


Can we nested try statements in java?

1103


What is a instance variable in java?

1047


What is the difference between processes and threads?

1054


How do you sort arraylist in descending order?

1021


What are the two parts of a conditional statement?

965


What is the difference between variable declaration and variable initialization?

1030


What is high level language in computer?

1022


What is overloading and overriding in java?

1229


What is are packages?

1035


Can interface be private in java?

1025


What is bifunction in java?

1203


What is java dot?

952


Is 0 true or false?

1003


Tell me the latest versions in java related areas?

1094