首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >在lambda表达式中使用 does ()意味着什么?

在lambda表达式中使用 does ()意味着什么?

提问于 2018-01-29 23:55:09
回答 2关注 0查看 249
代码语言:txt
复制
static void Main()
{
    // First build a list of actions
    List<Action> actions = new List<Action>();
    for (int counter = 0; counter < 10; counter++)
    {
        actions.Add(() => Console.WriteLine(counter));
    }

    // Then execute them
    foreach (Action action in actions)
    {
        action();
    }
} 

http://csharpindepth.com/Articles/Chapter5/Closures.aspx

请注意这一行:

actions.Add( ())括号内的()是什么意思?

回答

和开发者交流更多问题细节吧,去 写回答
相关文章

相似问题

相关问答用户
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档