W3Teacher
  • Explore
    Browse by field
    Artificial Intelligence Accounting & Finance Information Technology
    Show all fields
  • Interview Q&A
    • All Interview Questions
    • Beginner
    • Intermediate
    • Advanced
  • Practice
    • MCQs
    • Quizzes
    • Mock Interviews
  • About
  • Sign in
  • Get Started
  1. Home
  2. C#
  3. Delegates, Events & Lambdas
  4. Question
All 17 Delegates, Events & Lambdas questions
More in Delegates, Events & Lambdas
What is the difference between Func, Action and Predicate? What is a delegate in C#, and what does it represent conceptually? How do you write and use a lambda expression as a shorthand for a delegate? What is a delegate in C#, and how does it enable passing methods as values? What is a closure and what is a common pitfall? How do events differ from plain delegates? What is an event, and how does it differ from a plain public delegate field? What are multicast delegates, and in what order do their subscribed methods get invoked? How does variable capture (closures) work in a C# lambda expression, and what pitfall occurs when capturing a loop variable? What causes event-handler memory leaks and how do you prevent them?
Advertisement
C# › Delegates, Events & Lambdas

What is a delegate in C#?

Beginner

Answer

A delegate is a type-safe reference to a method, letting you pass behaviour as a parameter and invoke it later. Func<>, Action<> and Predicate<> are built-in delegates.
Func<int,int> square = x => x*x;
Action<string> log = Console.WriteLine;
Console.WriteLine(square(4)); // 16
Real-world example Passing a comparison or projection function into a sorting or LINQ method.
Next question What is the difference between Func, Action and Predicate?
All 17 Delegates, Events & Lambdas questions
W3Teacher

Learn technologies. Ace technical interviews.


    Learn
    • Technologies
    • Tutorials
    • Interview Questions
    • MCQs
    Practice
    • Quizzes
    • Mock Interviews
    • Bookmarks
    • Dashboard
    Get the latest questions & tips

    Fresh interview questions and practice tips, straight to your inbox.

    Company
    • About
    • Contact us
    • Privacy Policy
    • Terms & Conditions

    © 2026 W3Teacher. All rights reserved.