我发现了一些很奇怪的东西,希望能够更好的理解。C#方法组陌生性
var all = new List<int[]>{
new int[]{1,2,3},
new int[]{4,5,6},
new int[]{7,8,9}
};
all.ForEach(n => n.ForEach(i => Console.WriteLine(i)));
其可以被重写为:
...
all.ForEach(n => n.ForEach(Console.WriteLine));
如何能够离开了lambda表达式参数(I =>),并且仍然在当前项传递给console.WriteLine?
感谢您的任何见解。 -Keith
++为编译器的图像“吃”了Console.WriteLine的重载! – 2010-02-09 16:10:22
非常好地阐述。谢谢! – Keith 2010-02-09 16:45:18
很好的解释。 – 2010-10-28 09:36:04