2.12. The delegate Type
A delegate type creates a kind of function object. The delegate type looks like a function declaration, but instead it defines a type that can refer to one or multiple functions of a particular signature and return type. A delegate type has three primary characteristics:
A delegate object can address multiple methods rather than only one method at a time. When we invoke a delegate that addresses multiple methods, the methods are invoked in the order in which they are assigned to the delegate object. We'll see how to do that shortly.
The methods addressed by a delegate object do not need to be members of the same class. All the methods addressed by a delegate object must share the same prototype and signature. Those methods, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access