+ 2

What is need of runtime polymorphism in java?

28th Dec 2020, 5:27 PM
Yash Chaudhari
Yash Chaudhari - avatar
2 ответов
+ 5
Runtime polymorphism or Dynamic Method Dispatch is a process in which a call to an overridden method is resolved at runtime rather than compile-time. In this process, an overridden method is called through the reference variable of a superclass. From: https://www.javatpoint.com/runtime-polymorphism-in-java#:~:text=Runtime%20polymorphism%20or%20Dynamic%20Method,reference%20variable%20of%20a%20superclass.
28th Dec 2020, 6:43 PM
Matthew
Matthew - avatar
0
Because objects are not created until runtime. Therefore, dynamic polymorphism (method overriding) is best resolved at runtime.
28th Dec 2020, 8:32 PM
Ore
Ore - avatar