Lecture overview -- Keyboard shortcut: 'u'  Previous page: Delegates [Section] -- Keyboard shortcut: 'p'  Next page: Delegates that contain instance methods -- Keyboard shortcut: 'n'  Lecture notes - all slides together  Annotated slide -- Keyboard shortcut: 't'  Textbook -- Keyboard shortcut: 'v'  Alphabetic index  Help page about these notes  Course home    Data Access and Operations - slide 33 : 45

Delegates in C#

A delegate is a type the values of which consist of methods

Delegates allow us to work with variables and parameters that contain methods

Application.cs
A Delegate of simple numeric functions.
output
Output from the NumericFunction delegate program.
Application.cs
The static method Compose in class Application.
output
Output from the Compose delegate program.

Delegates make it possible to approach the functional programming style

Methods can be passed as parameters and returned as results to and from other methods

Go to exercise
Finding and sorting elements in an array