Lambda expression syntax and Types of Lambda expressions

Prabhukiran345
Posted by Prabhukiran345 under C# category on | Points: 40 | Views : 1715
Syntax of Lambda expression is:
(parameters) => expression-or-statement-block 

Types of Lamda expression:
1)Statement Lamda:Statement lambda has a statement block on the right side of the lambda operator "=>"
x => { return x * x; }; 

2)Expression Lamda:Expression lambda has only an expression (no return statement or curly braces), on the right side of the lambda operator "=>".
x => x * x; // here x*x is expression 

Comments or Responses

Login to post response