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 ...