Dynamic Method Dispatch or Runtime Polymorphism in Java - GeeksforGeeks
- Dynamic method dispatch allow Java to support overriding of methods which is central for run-time polymorphism.
- It allows a class to specify methods that will be common to all of its derivatives, while allowing subclasses to define the specific implementation of some or all of those methods.
- It also allow subclasses to add its specific methods subclasses to define the specific implementation of some.
- Static binding is done during compile-time while dynamic binding is done during run-time.
- private, final and static methods and variables uses static binding and bonded by compiler while overridden methods are bonded during runtime based upon type of runtime object
Read full article from Dynamic Method Dispatch or Runtime Polymorphism in Java - GeeksforGeeks
No comments:
Post a Comment