What are Delegates ?
Delegate is type safe function pointer. Means the return type of method must be similar to signature of Delegate.
What is the use Delegates in C Sharp?
Just check this and get the concept of programming without delegate in dotnet.
Now we will see the implementation of method PromotedEmployee using delegate.
There are 3 steps in delegate implementation.
A delegate is a type that represents references to methods with a particular parameter list and return type. When you instantiate a delegate, you can associate its instance with any method with a compatible signature and return type. You can invoke (or call) the method through the delegate instance.
Delegates are used to pass methods as arguments to other methods. Event handlers are nothing more than methods that are invoked through delegates. You create a custom method, and a class such as a windows control can call your method when a certain event occurs.
How to implement alternative way of Delegate using Lambda Expression ?
Lambda Expression :
1. it means => such as
and this is called expression >=
Nice way of expressing your ideas with us.thanks for sharing with us and please add more information's.
ReplyDeleteJAVA Training in Chennai
JAVA Training in Tambaram
IOS Training in Chennai
Big data training in chennai
Python Training in Chennai
Selenium Training in Chennai
JAVA training in Annanagar
Java courses in chennai anna nagar