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
Explain what are the steps for creating clr trigger?
Why we use get set in c#?
What is icomparable in c#?
what is object-oriented programming (oop) language?
Wcf and what is difference between wcf and web services?
How do I create a new form in c#?
Which is the best language for desktop application?
Why we use delegates in c#?
Name the method of servicebase class?
What is a console?
What is gac? How to put assembly in gac?
How do I create a multi language, multi file assembly?
Why do we need constructor in c#?
What is the implicit name of the parameter that gets passed into the set method/property of a class?
What are the properties of string?