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 is the difference between selection and projection?
What is razor view in c#?
What are the types of comments in c#?
What is code verification?
Why attributes are used in c#?
What language is c# similar to?
How do I do a case-insensitive string comparison?
What is master page in asp net c#?
Can an exception be thrown from a catch block?
What is eager loading in c#?
What is data adapter in c#?
Does c# support multiple inheritance (mi)?
Why we need get set property in c#?
What is the difference between Java and .NET garbage collectors?
How does insertion sort work?