Technical Discussion :: Java
Home > Technical Interview Q&A > Java > Discussion
26 / 66
What are the differences between Static Binding and Dynamic Binding?
Answer:
The difference between static and dynamic binding in Java.
- Static binding happens at compile-time while dynamic binding happens at runtime.
- Binding of private, static and final methods always happen at compile time since these methods cannot be overridden. Binding of overridden methods happens at runtime.
- Java uses static binding for overloaded methods and dynamic binding for overridden methods.
Asked In ::
Anjani Rai
13 Oct, 2019 1:07 PM
The difference between static and dynamic binding in Java.
- Static binding happens at compile-time while dynamic binding happens at runtime.
- Binding of private, static and final methods always happen at compile time since these methods cannot be overridden. Binding of overridden methods happens at runtime.
- Java uses static binding for overloaded methods and dynamic binding for overridden methods.