Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How can we Achieve Late binding in C#.Can any give one example.

Answers were Sorted based on User's Feedback



How can we Achieve Late binding in C#.Can any give one example...

Answer / sukriya

Polymorphism is the way of achieving late binding in csharp.
class A{}
class B:A{}
class Main
{
A a=new B();
}

Is This Answer Correct ?    25 Yes 6 No

How can we Achieve Late binding in C#.Can any give one example...

Answer / saurabh

Its using Virtual functions.
When compiler encounters virtual keyword in an function
defination, instead of binding to the function directly,
the compiler writes a bit of dispatch code that at runtime
will look at calling objects realtype and calls the
function accordingly.

EX.

class baseClass
{

protected virtual void PrintMessage()
{
Console.WriteLine("Hi From Base Class");
}
}

class derivedClass : baseClass
{
protected override void PrintMessage()
{
Console.WriteLine("Hi From Derived Class");
}

}

public static void Main()
{
baseClass b = new baseClass();
baseClass bd = new derivedClass();

b.PrintMessage(); // prints "Hi From Base Class"
bd.PrintMessage(); // prints "Hi From Derived Class"
}

Here the runtime detects the correct type of object stored
in bd i.e. derivedClass and calls dericedClass
implementation of PrintMessage().

Is This Answer Correct ?    20 Yes 4 No

How can we Achieve Late binding in C#.Can any give one example...

Answer / dileep

Late Binding means compiler doesn't have any prior knowledge
about COM's methods and properties and it is delayed until
runtime. Actually program learns the addresses of methods
and properties at execution time only i.e. when those
methods and properties are invoked. Late bound code
typically refers client objects through generic data types
like 'object' and relies heavily on runtime to dynamically
locate method addresses. We do late binding in C# through
reflection. Reflection is a way to determine the type or
information about the classes or interfaces.

Is This Answer Correct ?    18 Yes 4 No

How can we Achieve Late binding in C#.Can any give one example...

Answer / kishore.a

We can achieve Late binding using Dynamic polymorphism..

Is This Answer Correct ?    4 Yes 3 No

How can we Achieve Late binding in C#.Can any give one example...

Answer / satish

We can achive late binding through operator loading and
method ovealoading.

Is This Answer Correct ?    4 Yes 12 No

Post New Answer

More C Sharp Interview Questions

How does a function pointer returns a function pointer?

3 Answers   Wipro,


Define satellite Assembly?

0 Answers   Siebel,


What is lambda expression in c#?

0 Answers  


Write a program in c# to find the angle between the hours and minutes in a clock?

0 Answers  


What is the main purpose of linq?

0 Answers  


What is c# used for?

0 Answers  


Is var a data type?

0 Answers  


Hi Friends, I am going through Siemens Interview Procedure from last 1+1/2 months. I went through 1 written + 2 Technical + 1 Managerial Round process after which I got call from HR informing that "you are selected and we would like to meet you for HR round". HR round was very nominal compared to MR. HR Round last for hardly 5 mins. They told me that you will get the final result on Friday. Still I have not received any feedback from them. Please help!!!

0 Answers   Siemens,


What is difference between arraylist and list in c#?

0 Answers  


List down the reason behind the usage of c# language.

0 Answers  


What is difference between il and dll ?

0 Answers  


Are c# strings null terminated?

0 Answers  


Categories