import scala.collection.mutable.ArrayBufferobject 变长数组 { def main(args: Array[String]): Unit = { // 创建方式1 val arr1 = ArrayBuffer[Int]() // 创建方式2 val arr2 = ArrayBuffer("Hadoop", "Spark", "Flink") println(s"arr1:${arr1}") println(s"arr2:${arr2}") }}
scala变长数组
时间:2023-06-22
相关推荐