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 routing in c#?
User's session is explicitly killed by which method ?
Explain About ADO and its objects
How does c# achieve polymorphism?
Why is aws serverless?
What do you mean by winforms in c#?
What is the difference between protected and internal in c#?
What is a nullreferenceexception?
Why is .net so popular?
Why do we use anonymous method in c#?
What is jagged array?
What is part of a method signature in c#?
What is a byte in c#?
How more than one version of an assembly can keep in same place?
What is the default value of guid in c#?