We will learn Delegates In C# with example. and also learn the type of delegates in c#
Type of Delegate
1. Singlecast delegate
2. Multicast delegate
1. Singlecast delegate:
Whenever the instance of delegate points to the address of single method then this type of delegate is called single cast delegate.
2. Multicast Delegate:
Whenever the instance of delegate points to the address of multiple methods then this type of delegate is called the multicast delegate.
In order to work with delegate you follow the three steps:
step-1: Define a delegate.
Step-2: Instantiating a delegate or binding method to delegate.
step-3: Invoking a delegate.
# Anonymous Method: A method without having a name.
Advantages:
1. Write less code
2. Better performance
Related Video Links:
https://www.youtube.com/watch?v=Cow5nWIOx8I&t=1083s
https://www.youtube.com/watch?v=xbIgPwaAwjQ&t=7s
https://www.youtube.com/watch?v=aedwpjcBDCU&t=207s
https://www.youtube.com/watch?v=SM5tNdVmgqM&t=15s
Website: https://www.programmingwithshri.com/
Download
0 formats
No download links available.
Delegates In C# | Delegate part two | Type of Delegates | (C# Tutorials) | NatokHD