Static Binding vs Dynamic Binding - DevDummy

Latest

Views | Thoughts | Concepts | Techniques

Saturday, August 26, 2017

Static Binding vs Dynamic Binding



Static Binding
  • Static Binding occurs at compile time. Compiler decides the type to be bound in compilation process.
  • Private, final and static methods and variables uses static binding
  • Static binding uses Type information for binding
  • Overloaded methods are bonded using static binding
  • Internally it is required to determine the following facts for static binding mainly by the compilar
    • Definition/ Declaration/ Scope
  • Binding is happened considering the above aspects while compilation.

Dynamic Binding

  • Dynamic binding occurs during Run-time.
  • Virtual methods are bonded during run-time based upon run-time object.
  • Dynamic binding uses Object to resolve binding.
  • Overridden methods are bonded using dynamic binding at run-time.
  • Internally it is required to determine the following facts for dynamic binding mainly by the runtime
    • Activation/ Binding /Lifetime