Multiple choice technology programming languages

Which among the following is a valid syntax defining a delegate

  1. delegate {TheMethod( int Z) }

  2. delegate void TheMethod(int Z) ;

  3. delegate: TheMethod (int Z)

  4. delegate: {TheMethod (int Z)}

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

The correct delegate declaration syntax in C# is 'delegate returnType MethodName(parameters)'. Option B shows this correctly: 'delegate void TheMethod(int Z)'. The other options use incorrect syntax with braces, colons, or missing return types.