How anonymous method is different from a lambda expression?



How anonymous method is different from a lambda expression?..

Answer / Neeraj Kumar Bora

Anonymous methods and lambda expressions are both used to create unnamed functions, but they have some differences: 1) Anonymous methods are declared using the 'delegate' keyword, while lambda expressions use '=>'. 2) Lambda expressions offer a more concise and expressive syntax. 3) Lambda expressions can be implicitly typed based on the context in which they are used, while anonymous methods must have an explicit type.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Dot Net General Interview Questions

Will it go to finally block if there is no exception happened?

1 Answers  


What is the concept of inheritance in .net?

1 Answers  


What is the difference between a class and an object, and how do these terms relate to each other?

1 Answers  


What is Garbage Collection in .Net and what is the Garbage collection process?

4 Answers  


What is the transport protocol you use to call a seb service soap?

1 Answers  


What is the difference between vb.net and vc#.net?

1 Answers  


can we use private assembly in other project in dot net.

3 Answers  


How is .net core cross platform?

1 Answers  


What is exception handling?

1 Answers   Amazon,


What is different between User Control and Web Control and Custom Control?

2 Answers  


How to create properties and methods using controls?

1 Answers   CGI,


DateTime[] dt = new DateTime[10] for(i=0; i<10; i++) { dt[i] = DateTime(2008, 1, i+1) } How many heap object will be created for the above array. Choose the correct answer below. Ans: 1, 10, 11, 12

3 Answers  


Categories