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);
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.