What is early and late binding?

What is early and late binding?

1 Like

Binding refers to the process of converting identifiers (variables etc) into addresses. It is done for each variable and function and is done either at compile-time or at runtime.

  • In function overloading your method calls to the same name function are decided by the compiler that which function is going to be called at compile time. This is EARLY BINDING . By default early binding happens in C++.

  • In function Overriding, same thing is decided at runtime which method is going to be called. So it is LATE BINDING. This can be achieved by declaring a virtual function.