Answer Posted / wasimhajwane
lambda expression :
Lambda expression is introduce in c# version 3.0.Its a method without having declaration,
A lambda expression is a anonymous function mostly used to create delegate in LINQ.
Syntax:
parameter => expression or statement block.
simple program to understand lambda expreesion
class A
{
// we have to declare delegate here
public delegate int B(int a);
static void main()
{
B b=a=>a*a;
int res=b(5);
Console.WriteLine("result = ",res);
}
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Is c sharp and c# are same?
What is session variable in c#?
What is final keyword in c#?
What are Regex / regular expressions ?
What is callback method in c#?
What is fcl in c#?
What is difference between assembly and dll?
Can you have parameters for static constructors?
How to open a new form on button click in Windows forms?
Do void methods have parameters?
Is c# substring zero based?
What is type checking in c#?
Does c# support #define for defining global constants?
What is the do while loop code?
Is as keyword in c#?