difference between Early Binding and Late Binding?
Ans)
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
Example
' Add Imports statements to the top of your file.
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
Example
' 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)
'...
' 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)
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.
0 comments: