一.List var x = List(1,2,3,4) //x:List[Int] = List(1, 2, 3, 4) var y = List("x","y","z") //y: List[String] = List(x, y, z) 0 :: x //res6: List[Int] = List(0, 1, 2, 3, 4) x ::: y //List[Any] = List(1, 2, 3, 4, x, y, z) scala>…
Scala集合 一.数组 package top.ruandb.scala.Course04 object ArrayApp { def main(args: Array[String]): Unit = { //定义数组 val a = new Array[String](5) //直接定义 val b = Array("java","scala","bash","swift") val c=Array(1,2,3,4,5,…