what is lamda expression?
Answers were Sorted based on User's Feedback
Answer / andro
Lambda expression is an inline delegate introduced with C #
3.0 language. It’s a concise way to represent an anonymous
method. It provides a syntax to create and invoke
functions. Although Lambda expressions are simpler to use
than anonymous methods, they do slightly differ on how they
are implemented. Both anonymous methods and Lambda
expressions allow you define the method implementation
inline, however, an anonymous method explicitly requires
you to define the parameter types and the return type for a
method. Lambda expression uses the type inference feature
of C# 3.0 which allows the compiler to infer the type of
the variable based on the context.
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / pushparaj pentakota
representing in-line function in the form of an expression
is called lamda expression.this lamda expression acts as an
input to aggrigate methods like avg(),sum() etc...
| Is This Answer Correct ? | 0 Yes | 0 No |
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 |
Why do we need structs in c#?
What?s the difference between System.String and System.StringBuilder classes?
When do you absolutely have to declare a class as abstract (as opposed to free-willed educated choice or decision based on UML diagram)?
What?s the difference between an interface and abstract class?
What is difference between internal and protected internal in c#?
What are the different types of constructors in c#?
What are c# types?
Why attributes are used in c#?
Can we extend static class in c#?
What is public void in c#?
What is the c# equivalent of c++ catch (...), Which was a catch-all statement for any possible exception?
What is the base class of all classes in c#?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)