c# 匿名方法

时间:2020-07-19 15:52:53   收藏:0   阅读:80
匿名方法(Anonymous methods) 提供了一种传递代码块作为委托参数的技术

delegate void NumberChanger(int n); ... NumberChanger nc = delegate(int x) { Console.WriteLine("Anonymous Method: {0}", x); };


nc(10);
评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!