1

Assuming I have the following delegate:

public delegate int TestD(int p);

Is there any difference between

TestD del = MyMethod;

and

TestD del = new TestD(MyMethod);
blitzkriegz
  • 9,258
  • 18
  • 60
  • 71

1 Answers1

5

No, there is no difference: starting with C# 2.0, you can specify delegates using a method group.

Note: In an unlikely case that you need 1.0 compatibility, the second syntax would be your only option.

Community
  • 1
  • 1
Sergey Kalinichenko
  • 714,442
  • 84
  • 1,110
  • 1,523