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

Use of Checked and UnChecked operators?

2 Answers   TCS,


What is a int in c#?

0 Answers  


What is sqlcommand in c#?

0 Answers  


What are object pooling and connection pooling and difference? Where do we set the Min and Max Pool size for connection pooling?

0 Answers  


What do you mean by saying a "class is a reference type"?

0 Answers  






What is wpf c#?

0 Answers  


How more than one version of an assembly can keep in same place?

0 Answers  


What is strong data type in c#?

0 Answers  


What is the difference between interface and inheritance in c#?

0 Answers  


What is the advantage of static class in c#?

0 Answers  


what is the default access for a class

0 Answers   Cognizant,


Write the difference between TypeOf and GetType?

0 Answers   Wipro,


Categories