What is the difference between new Thread(void Target()) and new Thread(new ThreadStart(void Target()))?

后端 未结 1 1062
有刺的猬
有刺的猬 2020-12-11 08:15

Sorry if this has been asked before, but I would like a concise answer on the differences between the following two usages. VS seems to accept both of them as valid code.

相关标签:
1条回答
  • 2020-12-11 09:09

    The only difference is that the first one doesn't work in C# 1. The compiler of C# 2 and later, translates the first one into the second one.

    Method groups are implicitly convertible to delegate types with a compatible signature. This feature is called "(Implicit) method group conversion". Sometimes you need the second one to guide overload resolution, but that's not the case here.

    0 讨论(0)
提交回复
热议问题