What is delegates??
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Akkiraju IvaturiRank #473 · 5.3K reputationPosted Aug 11, 2012, 12:20 PM EDT
A delegate is a type that references a method. Once a delegate is assigned a method, it behaves exactly like that method.
Sukesh MarlaRank #461 · 5.4K reputationPosted Aug 11, 2012, 10:15 PM EDT
In real word scenario...see..
Basically we can we can take any object like pencil,Pen and pass to anybody but some like Water cannot be passed unless and until its placed inside a container.
Similary conside you created a function such that a integer value can be passed to it as parameter, a string can be, a float can be...But what if u want to create a function which will accept another function as parameter, Then delegate comes handy.
Once you make delegate pointing to a function u can do anything with that function, you can call that function synchronously, asynchronously or even pass as a parameter to some other function.
Hope It Helped. Please Check This is Currect Answer.