What is a differenece when we call a method by a Delegate or when we call a method by a making a class object using simple approach.
What is the advanges of these two when we use these approach with example
Loading
What is a differenece when we call a method by a Delegate or when we call a method by a making a class object using simple approach.
What is the advanges of these two when we use these approach with example
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 attend4days leftRegister
VulpesRank #55 · 29.2K reputationPosted Nov 6, 2013, 4:07 AM EST
The disadvantage of delegates is that an indirect call is slower than a direct call and needs more code.
The main advantages are that:
1 . More than one method can be called via a single delegate invocation.
2. A delegate enables method pointers to be passed to other methods so they can be called back from there.
3. Delegates are the basis of events in .NET.
The following simple example illustrates these points: