What are Delegates in C#?

Simple as it should be

A reference pointer to a method

A Delegate is a variable that holds the reference to a method. Hence it is a function pointer of reference type. All Delegates are derived from System.Delegate namespace. Both Delegate and the method that it refers to can have the same signature.

Delegates are used to raise events and handle them. Always a delegate needs to be declared first and then the Events are declared.

Leave a Reply

Your email address will not be published. Required fields are marked *