Difficulty: Easy
Correct Answer: If signatures of two methods are same they can be called through the same delegate object.
Explanation:
Introduction / Context:
Delegates in C#.NET are type-safe function pointers that encapsulate a method reference and, optionally, a target object. This question tests what delegates can and cannot invoke, and the importance of method signatures for delegate compatibility.
Given Data / Assumptions:
Concept / Approach:
The core rule is signature compatibility: a single delegate type can call any method whose signature matches the delegate’s signature. Static and instance targets are both supported. Claims that categorically deny static or instance method support are incorrect. Variable argument methods are possible if the delegate type is declared with a suitable params parameter.
Step-by-Step Solution:
Verification / Alternative check:
Create delegate int Op(int x, int y); and point it to multiple methods Add and Subtract; both are callable if the signatures match.
Why Other Options Are Wrong:
Common Pitfalls:
Assuming delegates ignore return type or that they can freely coerce mismatched signatures—C# requires type safety.
Final Answer:
If signatures of two methods are same they can be called through the same delegate object.
Discussion & Comments