【Scala筆記——道】Scala 循環遍歷 for詳解

Scala for循環 基本使用 加強型for循環 scala基本for循環以下,代碼將names遍歷並打印包含的名字。html val names = Seq("Kitty", "Tom", "Luke", "Kit") for (name <- names) { println(name) } 相較Java,語法層面來看只是將 :換成<-。實際上因爲Scala已經將:用於類型定義,這
相關文章
相關標籤/搜索