Scala之集合函数_scala中定义一个整形定长数组包含五个元素,遍历数组查找数组中的最大值并输出-CSDN博客

网站介绍:文章浏览阅读637次。目录一、基本操作二、衍生集合三、初级函数四、高级函数五、wordcount案例一、基本操作(1)获取集合长度(2)获取集合大小(3)循环遍历(4)迭代器(5)生成字符串(6)是否包含 def main(args: Array[String]): Unit = { val list: List[Int] = List(1, 2, 3, 4) val set: Set[Int] = Set(2, 4, 6, 8) //获取集合长度_scala中定义一个整形定长数组包含五个元素,遍历数组查找数组中的最大值并输出