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
What does it mean that strings are immutable?
Is binary a low level language?
Tell me about different OOPS concepts.
Is array a class in java?
What are the differences between stringbuffer and stringbuilder?
What do you mean by light weight and heavy weight components?
How to sort an array in java without using sort method?
Howto get an object that will perform date & time calculations then format it for output in some different locales with different date style.can ne1 tel me the answer of this question.pls
How to Sort Strings which are given in List and display in ascending order without using java api.
What is final keyword in java? Give an example.
What is a priority queue java?
How many types of keywords are there?
Objects or references which of them gets garbage collected?
What is unicode full form?
What is comparator in java?