© Vaskaran Sarcar 2018
Vaskaran SarcarInteractive C#https://doi.org/10.1007/978-1-4842-3339-9_10

10. Delegates and Events

Vaskaran Sarcar
(1)
560066 Bangalore, Karnataka, India
 

Introduction to Delegates

Teacher starts the discussion: Delegates are one of the most important topics in C# programming, and they have made C# very powerful. Delegates are reference types derived from System.Delegate. They are similar to object references but the key distinction is that they point to methods. We can achieve type safety with the use of delegates. For this reason, sometimes we refer to them as type-safe function pointers.
Points to Remember
  • An object reference points to a particular type of object (e.g., when we write A ob=new A(); we mean that ob is a reference ...

Get Interactive C#: Fundamentals, Core Concepts and Patterns now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.