Technical Discussion :: Java
Home > Freshers > Technical Interview Questions > Java
7. 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 :: Wipro Sopra Steria
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.