Delegates in c#

What is Delegate ?

                         
We can say a delegate is a type safe function pointer which holds methods reference in object. As per MSDN it's a type that references to a method.

So you can assign more than one methods to delegates with same parameter and same return type.

When to use a delegate


A class may need more than one implementation of the method
The caller has no need access other properties, methods, or interfaces on the object implementing the method
It is desirable to encapsulate a static method

Comments