Skip to Content
Microsoft® Visual C#® .NET 2003 Kick Start
book

Microsoft® Visual C#® .NET 2003 Kick Start

by Steven Holzner
June 2003
Intermediate to advanced
624 pages
12h 41m
English
Sams
Content preview from Microsoft® Visual C#® .NET 2003 Kick Start

Working with Delegates

Delegates let you pass methods as parameters. They provide you with another form of polymorphism, because you can assign methods to delegates at runtime, leaving the rest of your code unchanged but calling the methods you specify at runtime. You declare a delegate like this:

[attributes] [modifiers] delegate result-type identifier ([formal-parameters]);

Here are the parts of this statement:

  • attributes (Optional)— Hold additional declarative information, as we'll see in Chapter 14.

  • modifiers (Optional)— The allowed modifiers are new and a valid combination of the four access modifiers.

  • result-type The result type, which matches the return type of the method.

  • identifier The delegate name.

  • formal-parameters (Optional)— ...

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

Microsoft® .NET Kick Start

Microsoft® .NET Kick Start

Hitesh Seth

Publisher Resources

ISBN: 0672325470Purchase book