C# - Anonymous delegate

前端 未结 7 1838
有刺的猬
有刺的猬 2021-02-07 08:00

Like Anonymous Methods ,the delegates i am declaring down using \"delegate\" keyword are anonymous delegates?

namespace Test
{
    public delegate void MyDelegat         


        
7条回答
  •  独厮守ぢ
    2021-02-07 08:17

    There's no such thing as an "anonymous delegate" (or rather, that's not a recognised term in the C# specification, or any other .NET-related specification I'm aware of).

    There are anonymous functions which include anonymous methods and lambda expressions.

    Your code shows plain old anonymous methods - although they are using the one feature lambda expressions don't have: the ability to not express the parameters at all when you don't care about them.

提交回复
热议问题