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


Please Help Members By Posting Answers For Below Questions

What is a “stateless” protocol ?

543


What is member in java?

478


Where import statement is used in a java program?

600


What is private public protected in java?

561


What is a boolean expression in java?

517






State two differences between C and Java.

679


Define immutable object?

571


Why do we need wrapper class?

525


Which graphs are functions?

484


How do you include a string in java?

515


When is the arraystoreexception thrown?

556


What is java oops?

542


Differences between external iteration and internal iteration?

563


What is the difference between preparedstatement and statement in java?

539


Describe method overriding

567