Static Binding vs Dynamic Binding - Coded Java

Latest

Quality & Simple Java Content

Aug 26, 2017

Static Binding vs Dynamic Binding

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, 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 compiler
    • 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

No comments:

Post a Comment