What is runtime polymorphism or dynamic method dispatch?

DWQA QuestionsCategory: JavaWhat is runtime polymorphism or dynamic method dispatch?
Editor Staff asked 2 months ago

What is runtime polymorphism or dynamic method dispatch?

1 Answers
Editor Staff answered 2 months ago

In Java, runtime polymorphism or dynamic method dispatch is a process in which a call to an overridden method is resolved at runtime rather than at compile-time. In this process, an overridden method is called through the reference variable of a superclass. Let’s take a look at the example below to understand it better.