1.

What is early and late binding?

Answer»

Early Binding

The NAME itself describes that compiler knows about what kind of object it is, what are all the methods and properties it contains. As soon as you declared the object, .NET Intellisense will populate its methods and properties on click of the DOT button

Common Examples:

  • ComboBox cboItems;
  • ListBox lstItems;

In the above examples, if we type the cboItem and place a dot followed by, it will automatically populate all the methods, events and properties of a combo box, because compiler already know it's an combobox.

Late Binding
The name itself describes that compiler does not know what kind of object it is, what are all the methods and properties it contains. You have to DECLARE it as an object, LATER you need get the type of the object, methods that are stored in it. Everything will be known at the run time.

Common Examples:

  • Object objItems;
  • objItems = CreateObject("DLL or Assembly name");

Here during the compile time, type of objItems is not determined. We are creating an object of a dll and assigning it to the objItems, so everything is determined at the run time.



Discussion

No Comment Found