Difference Between Static and Dynamic Binding

Computer ProgrammingProgrammingMiscellaneous

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.

raja
Published on 24-Mar-2021 18:47:31
Advertisements