Dynamic Binding in Java
Dynamic Binding :
Association of method call to the method body is known as binding. Dynamic binding compiler doesn’t decide the method to be called. Overriding is a perfect example of dynamic binding. In overriding both parent and child classes have same method.
print in superclass. print in subclass.
This is the method of sub class
Static Binding or Early Binding:
The binding which can be resolved at compile time by compiler is known as static or early binding. The binding of static, private and final methods is compile-time.
Human walks Human walks