In this article we will look at dynamic method dispatch in Java which is a way to provide run-time polymorphism. What is dynamic method dispatch? Dynamic method dispatch is a mechanism which resolves the call to a overridden method at run-time based on the type of object being referred. When is dynamic method dispatch possible? It is possible only when the following are satisfied: A class inherits from another class (inheritance) Super class variable refers a sub class object A overridden method is invoked using the super class reference Why dynamic method dispatch? Dynamic method dispatch is the way to
The post How to Dynamically Dispatch a method in java programming appeared first on Coding Security.
How to Dynamically Dispatch a method in java programming
read more
Tidak ada komentar:
Posting Komentar