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());
luni, 25 august 2014
Abonați-vă la:
Postare comentarii (Atom)
Niciun comentariu:
Trimiteți un comentariu