Question: What is a delegate?

  1. A delegate is an object or collection initializer that adds flexibility, readability and maintainability in C#.
  2. A delegate in .NET is similar to a function pointer in C or C++. Using a delegate allows the programmer to encapsulate a reference to a method inside a delegate object.
  3. A delegate is a collection initializer that adds flexibility, readability and maintainability in .NET.
  4. A delegate is an extension method. Using a delegate allows the programmer to add flexibility, readability and maintainability in .NET.

Answer: The correct answer of the above question is Option B:A delegate in .NET is similar to a function pointer in C or C++. Using a delegate allows the programmer to encapsulate a reference to a method inside a delegate object.