Skip to Main Content
The C# Programming Language, Third Edition
book

The C# Programming Language, Third Edition

by Anders Hejlsberg, Mads Torgersen, Scott Wiltamuth, Peter Golde
October 2008
Intermediate to advanced content levelIntermediate to advanced
784 pages
18h 11m
English
Addison-Wesley Professional
Content preview from The C# Programming Language, Third Edition

15. Delegates

Delegates enable scenarios that other languages—such as C++, Pascal, and Modula—have addressed with function pointers. Unlike C++ function pointers, however, delegates are fully object oriented. Also unlike C++ pointers to member functions, delegates encapsulate both an object instance and a method.

A delegate declaration defines a class that is derived from the class System.Delegate. A delegate instance encapsulates an invocation list, which is a list of one or more methods, each of which is referred to as a callable entity. For instance methods, a callable entity consists of an instance and a method on that instance. For static methods, a callable entity consists of just a method. Invoking a delegate instance with an appropriate ...

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.
Start your free trial

You might also like

C Programming Language, 2nd Edition

C Programming Language, 2nd Edition

Brian W. Kernighan, Dennis Ritchie
Learn C# Programming

Learn C# Programming

Marius Bancila, Prakash Tripathi, Raffaele Rialdi, Ankit Sharma
Programming C#

Programming C#

Jesse Liberty
Head First C#, 4th Edition

Head First C#, 4th Edition

Andrew Stellman, Jennifer Greene

Publisher Resources

ISBN: 9780321592279Purchase book