Monday, February 1, 2010

What are delegates and why are they required? -

Delegates are like type safe function pointers. We need delegates as they can be used to write much more generic functions which are type safe also.
It encapsulates the memory address of a function in the code. Events are created using delegates in .Net. When an event is published/thrown, the framework examines the delegate behind the event and then calls the function that is referred to by the delegate.

0 Comments: