Fork me on GitHub
摘要: 映射和元组操作 构造Map 更新映射中的值 迭代映射 scala val scores = scala.collection.immutable.SortedMap("Bob" 10,"michael" 12) scala // import scala.collection.javaConvers 阅读全文
posted @ 2018-09-09 23:42 codegeekgao 阅读(601) 评论(0) 推荐(0)
摘要: 数组操作 初始化固定长度的数组 创建可变的数组(类似java的集合) 遍历数组和数组缓冲 scala val list = Array(8, 5, 1, 2, 3, 4) val bs = list.sorted.toBuffer bs.append(1,2) println(bs) // 统计集合 阅读全文
posted @ 2018-09-09 01:41 codegeekgao 阅读(12058) 评论(1) 推荐(1)