What is early binding and late binding

Answers were Sorted based on User's Feedback



What is early binding and late binding..

Answer / laks

Early binding - Assigning values to variables during design
time or exposing object model at design time.

Late Binding - Late binding has the same effect as early
binding. The difference is that you bind the object
library in code at run-time

Is This Answer Correct ?    128 Yes 17 No

What is early binding and late binding..

Answer / kanak

From a program point of view during early binding the
function call is resolved at compile time.
In case of late binding the function call is resolved at
run time with the superclass reference object. It calls the
function of that subclass whose object is being referred by
the superclass reference object.

Is This Answer Correct ?    63 Yes 19 No

What is early binding and late binding..

Answer / prasad sethuramalingam

BINDING :A process when an object is assigned to an object
variable.
EARLY BINDING:
An object is early bound when it is assigned to a variable
declared to be of that specific object type. 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 FileStream:
' Create a variable to hold a new object.
Dim FS As System.IO.FileStream
' Assign a new object to the variable.
FS = New System.IO.FileStream("C:\tmp.txt", _
System.IO.FileMode.Open)
LATE BINDING:
By contrast, an object is late bound when it is assigned to
a variable declared to be of type Object. Objects of this
type can hold references to any object, but lack many of the
advantages of early-bound objects. For example, the
following code fragment declares an object variable to hold
an object returned by the CreateObject function:

' To use this example, you must have Microsoft Excel
installed on your computer.
' Compile with Option Strict Off to allow late binding.
Sub TestLateBinding()
Dim xlApp As Object
Dim xlBook As Object
Dim xlSheet As Object
xlApp = CreateObject("Excel.Application")
' Late bind an instance of an Excel workbook.
xlBook = xlApp.Workbooks.Add
' Late bind an instance of an Excel worksheet.
xlSheet = xlBook.Worksheets(1)
xlSheet.Activate()
' Show the application.
xlSheet.Application.Visible = True
' Place some text in the second row of the sheet.
xlSheet.Cells(2, 2) = "This is column B row 2"
End Sub
I took this from this URL:
http://msdn.microsoft.com/en-us/library/0tcf61s1(VS.80).aspx

Is This Answer Correct ?    38 Yes 6 No

What is early binding and late binding..

Answer / shakti prasad prusty

Early binding - Assigning values to variables during design
time or exposing object model at design time.

Late Binding - Late binding has the same effect as early
binding. The difference is that you bind the object
library in code at run-time

Is This Answer Correct ?    31 Yes 14 No

What is early binding and late binding..

Answer / muhammed zakeer.ms

Early binding means that our code directly interact with
with the obj by directly calling its method.Since compiler
knows the obj data type ahead of time.it can directly
compile our code invokes methods on the obj

Is This Answer Correct ?    20 Yes 6 No

What is early binding and late binding..

Answer / santhosh. p. krishna

Early binding - Assigning values to variables during design
time.

Late binding has the same effect as early
binding. The difference is that you bind the object
library in code at run-time

Is This Answer Correct ?    10 Yes 6 No

What is early binding and late binding..

Answer / susheel maan

Compiler can bind the objects to methods at run time this
is called late binding or dynamic binding.

Compiler can bind the objects to mehods at compile time
this is called early binding or static binding.

Is This Answer Correct ?    1 Yes 0 No

What is early binding and late binding..

Answer / chitranjan

Early Binding :-1 - In C#, early binding is a process in
which a variable is assigned to a specific type of object
during its declaration to create an early-bound object.

Late Binding - 1 - Late bound means the target method is
looked up at run time. Often the textual name of the method
is used to look it up. If the method isn't there, bang. The
program will crash or go into some exception handling scheme
at run time.

If you want to get more difference then use this link or
copy and past in your browser
http://dotnetnukes.blogspot.in/2013/06/late-binding-and-early-binding-in-c.html

Is This Answer Correct ?    0 Yes 0 No

What is early binding and late binding..

Answer / bir

when compile time perform any operation with variables

Is This Answer Correct ?    6 Yes 7 No

What is early binding and late binding..

Answer / ashish dwivedi

early binding---it happens at compile time. it will only
take care of programing part which is all ready defined by
the major classes that we have included..like
#include<stdio.h>
main()
(
printf("hello"); ///predefined function in STDIO.H it will
come under early binding. because STDIO.h has defined the
working of Printf(); Method of function
void abc(a,b),
it is user defined method or function...there is a no
definition of ABC(a,b) available in STDIO.H or any library
so this will come under late binding- at Run time

Is This Answer Correct ?    8 Yes 10 No

Post New Answer

More C Sharp Interview Questions

Hi all,I am the beginner. Please tell use of finally block.

6 Answers   IBM,


What is lazy class in c#?

0 Answers  


What's the implicit name of the parameter that gets passed into the set method/property of a class?

0 Answers  


Why can't we use a static class instead of singleton?

0 Answers  


What is the difference between const and static read-only?

0 Answers  






What exactly happens when we debug and build the program?

0 Answers  


If we inherit a class do the private variables also get inherited ?

2 Answers   TCS,


Where’s global assembly cache located on the system?

0 Answers  


Which type of variables are under the control of garbage collector?

4 Answers   Kanbay,


Explain the difference between a sub and a function in c#.

0 Answers  


What namespaces are necessary to create a localized application?

2 Answers  


What is double c#?

0 Answers  


Categories