what is a delegate? what it is used for?

Answer Posted / subbu

Delegates are a type that references method. Normally when
we calling a method we will pass some data to that method
as input parameter. But in some scenario we might need to
pass method as input parameter to other method in such case
we can use delegate.
Delegate wraps any method which matches its signature,
calling a delegate result in calling a method so this gives
the ability to call the method programmatically based on
our business needs.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain concurrency with aop?

523


What is the main usage of keyword “virtual” ? How does it work for a method or property?

515


what are pointer types in c#

552


What is dependency injection?

559


what is a enumeration in c#

572






When was c# created?

531


What is a function c#?

491


What is a satellite assembly in c#?

554


Can I use parseint?

485


What language do desktop applications use?

480


Explain About Postback

557


Why do we need static in c#?

511


What is garbage collection? How to force garbage collector to run?

498


What is uint64?

518


Can we override interface methods in c#?

473