编译此代码:
var arr = new[] { 1, 3, 5, 7, 9, 11, 13, 15, 17, 19 };
arr.ForEach(x =>
{
Console.WriteLine(x);
});
失败:
error CS7036: There is no argument given that corresponds to the required formal parameter 'action' of 'Array.ForEach<T>(T[], Action<T>)'
为什么?
拉莫斯之舞
相关分类