【发布时间】:2013-06-15 20:33:45
【问题描述】:
为什么我可以写这样的东西而没有编译错误:
wordCount foreach(x => println("Word: " + x._1 + ", count: " + x._2)) // wordCount - is Map
即我声明了x 变量。
但在这种情况下我不能使用魔法_ 符号:
wordCount foreach(println("Word: " + _._1 + ", count: " + _._2)) // wordCount - is
【问题讨论】: