Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

The process of traversing foreach by Scala

Shulou Source: shulou.com Published: 2022-06-02 04:06:09 11月27日 Update

This article mainly introduces "Scala traversing foreach process". In daily operation, I believe many people have doubts about Scala traversing foreach process. Xiaobian consulted various materials and sorted out simple and easy operation methods. I hope to help you answer the doubts of "Scala traversing foreach process"! Next, please follow the small series to learn together!

##traverse foreach

list traversal

var l = List(1,2,3,4,5)l.foreach(i=>println(i))

map traversal

var m = Map("tony" -> 80, "bob" -> 90) m.foreach(kv => println(kv._ 1, kv._ 2))

##Map

val l = List("hive","hadoop","spark") val books= l.map(s=>s.toUpperCase) for(x s.toList) for(x

Tags: Process learning more help practical next articles methods theories knowledge articles websites materials follow questions easy to use practice solutions Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Docker Microsoft Shulou Technology Linux