What is Delegate and what is it used for?
Submitted by: AdministratorDelegate is kinda like a pointer to a function in C++ or like an event handler in Java
You can use it to “multicast” which means running multiple functions in different instances of object already created.
This is useful when you want your objects to “register” to an event raised by another object.
The way it works is the object you are registered to listen to receives the delegate of the function it is supposed to run in your object, the delegate is then run from it. (if you switch the word delegate for pointer, this would be much simpler)
Submitted by: Administrator
You can use it to “multicast” which means running multiple functions in different instances of object already created.
This is useful when you want your objects to “register” to an event raised by another object.
The way it works is the object you are registered to listen to receives the delegate of the function it is supposed to run in your object, the delegate is then run from it. (if you switch the word delegate for pointer, this would be much simpler)
Submitted by: Administrator
Read Online Dot Net Job Interview Questions And Answers
Top Dot Net Questions
☺ | Difference Abstract class and Interface in .NET? |
☺ | Explain webFarm Vs webGardens in .NET? |
☺ | What are possible implementations of distributed applications in .NET? |
☺ | What is "Common Type System" (CTS) in .NET? |
☺ | What is the difference between VB and VB.NET? |
Top Dot Net Technologies Categories
☺ | MSF Interview Questions. |
☺ | .Net Architecture Interview Questions. |
☺ | ASP.Net MVC Interview Questions. |
☺ | Entity Framework Interview Questions. |
☺ | C# (Sharp) Programming Language Interview Questions. |