Multiple choice technology programming languages

A delegate is

  1. A method without code

  2. A method which is called when an event is triggered.

  3. A method which doesnot contain code.

  4. A reference to a method which itself doesnot contain code.

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

A delegate is a reference to a method - it's a type-safe function pointer that holds a reference to a method with a matching signature. The delegate itself doesn't contain implementation code, it merely references a method that does. Option D correctly describes a delegate as a reference to a method, which itself contains the actual code. Options A, B, and C are incorrect descriptions of what delegates represent.