What is delegate and its features

Delegate in C# is similar to a function pointer in C or C++. A delegate is simply a type that references a method inside a delegate object .Once we assigned delegate to a method its behaves same as the method. We can use used this method like any other method with parameters and a return value. The delegate object can then be passed to code which can call the referenced method without having to know at compile time which method will be invoked.With the h
elp of delegate we can programmatically change method calls, and also plug new code into existing classes.There are some features of delegate

(1)delegates allow methods to be passed as parameters.

(2) Delegates can be used to define callback methods.

(3)Delegates are similar to C plus function pointers, but are type safe.

(4) multiple methods can be called on a single event.

(5) Methods donot need to match the delegate signature exactly.