Scala Puzzlers 系列(一):佔位符的使用

如下兩個表達式,輸出的結果分別是什麼?List

List(1,2).map{i => println("Hi"); i + 1}
List(1,2).map{ println("Hi"); _ + 1}map

相關文章
相關標籤/搜索