difference between Early Binding and Late Binding?

 Posted by Kamlesh420 on 12/14/2011 | Category: ASP.NET Interview questions | Views: 15597 | Points: 40

Early Binding:

Compiler bind the objects to methods at the compile time.This is called early binding or static binding.Function overloading is example for early binding. Early bound objects allow the compiler to allocate memory and perform other optimizations before an application executes. For example, the following code fragment declares a variable to be of type


' Add Imports statements to the top of your file.
Imports System.IO

' Create a variable to hold a new object.
Dim FS As FileStream
' Assign a new object to the variable.
FS = New FileStream("C:\tmp.txt", FileMode.Open)

Late Binding:

Compiler bind the objects to methods at the runtime.This is called late binding or dynamic binding.Function overriding is example for late binding. Objects of this type can hold references to any object, but lack many of the advantages of early-bound objects.

Source: cognigent | Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response