Difference Between Static and Dynamic Binding

In this post, we will understand the difference between static binding and dynamic binding.

Static Binding

  • It is resolved at compile time.

  • It uses type of the class and fields.

  • It uses private, final, and static methods and variables.

  • Example: Overloading

Dynamic Binding

  • It is resolved during run time.

  • Virtual methods use this technique.

  • It uses objects to resolve the binding.

  • Example: Method overriding.