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
What are primitive types in c#?
Why array is faster than arraylist in c#?
What is a strong name in c#?
Why would you use a class property in c#?
What is array and arraylist?
What is the advantage of generics in c#?
What is difference between interface and abstraction?
What do you mean by saying a "class is a reference type"?
Which is faster hashtable or dictionary?
What is unsigned int?
Is c# strongly typed?
Are c and c# the same thing?
What is the difference between Singleton design pattern and Factory design pattern?
What is exe in c#?
Can constructor have return type c#?