C# events and delegates. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

C# events and delegates.

Can anyone explain me, how to use these functions?

3rd Mar 2019, 2:09 AM
Iago Augusto Alves Martins
Iago Augusto Alves Martins - avatar
3 Answers
+ 4
A delegate is a type. It is a very special type because an instance of this type can point to a method. A event is a instance of a delegate. When calling a event you start a method. https://code.sololearn.com/c3Ua61bw096U https://www.tutorialspoint.com/csharp/csharp_events.htm
4th Mar 2019, 9:30 PM
sneeze - avatar
+ 1
Delegates are used when you want to send method as parameter ,you can think about delegates. Delegates much useful when implementing framework classes and client classes. Framework or client mostly are not going to change frequently once they implemented so we need to inject the logic these classes using delegates. Coming to events , events just encapsulated over the delegates
12th Apr 2020, 6:07 PM
vinod kumar
vinod kumar - avatar
Thank you very much!!!
4th Mar 2019, 9:34 PM
Iago Augusto Alves Martins
Iago Augusto Alves Martins - avatar