preetam sharma
What is early binding and late binding?
By preetam sharma in ASP.NET on Mar 01 2007
  • Mar, 2007 8

    Late Binding object o = 5; o.tostring(); Early binding: int i=10; i.tostring(); here the complier knows in case 2 that which version of tostring method is to be called [since int inherits from object, there are two versions of tostring method, but since it is directly known that the class of i is int then no need to resolve the version info for method tostring] whereas in case 1 compiler has to peep into the object to see which type of data is contained within the object and then depending upon that it selects the tostring method and calls it accordingly. Regards Samir

    • 0
  • Sathish
    Mar, 2007 1

    When a call to a method is resolved during compile time, it is called early binding. And if it is resolved during runtime, it is called late binding.

    • 0
  • shrinath inamdar
    Mar, 2007 1

    Early binding:

    Manually binding the Object file is called early binding

    eg .

    Dim oExcel As Excel.Application

      Set oExcel = CreateObject("Excel.Application")

    and

    Late binding has the same effect as early binding.  The difference is

    that you bind the object library in code at run-time.

    Dim oExcel As Excel.Object

      Set oExcel = CreateObject("Excel.Application")

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS