Difficulty: Easy
Correct Answer: Delegate is a value type.
Explanation:
Introduction / Context:
C# delegates are central to events, callbacks, and LINQ expression trees. This question asks you to identify a false statement regarding delegate characteristics.
Given Data / Assumptions:
Concept / Approach:
Delegates are sealed reference types deriving from MulticastDelegate. They are not value types. Multicast invocation lists allow one delegate instance to call multiple compatible methods. Type safety demands that the target method’s parameter and return types match the delegate declaration.
Step-by-Step Solution:
Verification / Alternative check:
Reflect on typeof(Action) to see BaseType = MulticastDelegate and reference-type behavior.
Why Other Options Are Wrong:
They accurately describe real delegate features in C#.
Common Pitfalls:
Confusing structs (value types) with delegates, which are classes.
Final Answer:
Delegate is a value type.
Discussion & Comments