What you want to see on DotNetFunda.com ?
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 18246 |  Welcome, Guest!   Register  Login
 Home > Interview Questions > C# Interview Questions > What is Anonymous functions ? ... ...

What is Anonymous functions ?

Interview question and answer by: Niladri.Biswas | Posted on: 7/21/2012 | Category: C# Interview questions | Views: 919 | | Points: 40


Answer:

An anonymous function is an "inline" statement or expression that can be used wherever a delegate type is expected. We can use it to initialize a named delegate or pass it instead of a named delegate type as a method parameter
e.g.

In C# 2.0:

var output = doSomething(variable, delegate {

// Anonymous function code
});


In C#4.0:

var output = doSomething(variable, () => {

// Anonymous function code
});

Asked In: Many Interviews | Alert Moderator 
Found interesting? Add this to:


>> Write Response - Respond to this post and get points

Even more ... | Submit Interview Questions and win prizes!

More Interview Questions from Niladri.Biswas

Even more ... | Submit Interview Questions and win prizes!


About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/21/2013 8:21:06 PM