what is dynamic method dispatch ?
Answer Posted / ramya
Dynamic method dispatch is the process the Java runtime
system uses to determine which method implementation to call
in an inheritance hierarchy. For example, the Object class
has a toString() method that all subclasses inherit, but the
String class overrides this method to return its string
content. If a String or other object type is assigned to an
Object reference using application logic, the Java compiler
cannot know in advance where a call to the toString() method
will be resolved, it must be determined dynamically at runtime.
| Is This Answer Correct ? | 7 Yes | 3 No |
Post New Answer View All Answers
What is data member in java?
How to change the priority of thread or how to set the priority of thread?
What is finalize()? Is finalize() similar to a destructor?
What is the difference between a checked and an unchecked exception?
Are global variables initialized to zero?
What are encapsulation, inheritance and polymorphism?
What will happen when using pass by reference in java?
What is a qms manual?
What is thread safe in java?
What is meant by null and void?
What is use of super keyword in java?
What is the purpose of the file class in java programming?
Explain about field hiding in java?
What is string builder?
Differentiate between a constructor and a method? Can we mark constructors final?