static void Main(string[] args)
{
//LINQ简化
Action<string> f1 = s =>
Console.WriteLine(s);
//委托
Action<string> f11 = delegate (string s)
{
Console.WriteLine(s);
};
//LINQ简化
Func<int, bool> f2 = i => i > 5;
//委托
Func<int, bool> f3 = delegate (int i)
{
return i > 5;
};
f1("123");
f11("1234");
f2(4);
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/282351.html