In the previous article, we have learned about the delegates and their types. Now in this article, we are going to discuss the ‘generic delegates in C#‘.
In c#, An anonymous method is a method that has no name and allows us to create delegate instances without writing a separate method.
What is Anonymous Method In C#?
In C#, delegates are reference types available in the system namespace.
A delegate is a type-safe function pointer that can contain one or more references to methods with the same signature and return type as the delegate. Delegates are used to pass methods as parameters to other methods. Event handlers are nothing more than methods called through delegates.
The delegate in C # is very similar to the function pointer in C and C ++, but unlike the function pointer in C, the delegate is object-oriented, type-safe, and secure.