luni, 25 august 2014

=> Operator (lambda)

The => operator is called the lambda operator. 
It is used in lambda expressions to separate the input variables on the left side from the lambda body on the right side. 

Examples:

1.
 delegate int Power(int i);

Power myDelegate = x => x * x;
int j = myDelegate(7); //j = 49
MessageBox.Show(j.ToString());

Niciun comentariu:

Trimiteți un comentariu