摘要: 1 package chapter07 2 3 object Test10_Tuple { 4 def main(args: Array[String]): Unit = { 5 // 1. 创建元组 3元祖就是有3个元素 6 val tuple: (String, Int, Char, Boole 阅读全文
posted @ 2022-01-19 21:26 靠谱杨 阅读(74) 评论(0) 推荐(0)
摘要: 1 package chapter07 2 3 import scala.collection.mutable 4 5 object Test09_MutableMap { 6 def main(args: Array[String]): Unit = { 7 // 1. 创建map 8 val m 阅读全文
posted @ 2022-01-19 21:20 靠谱杨 阅读(1342) 评论(0) 推荐(0)
摘要: 1 package chapter07 2 3 object Test08_ImmutableMap { 4 def main(args: Array[String]): Unit = { 5 // 1. 创建map 使用伴生对象( ) Map默认就是Immutable.Map不可变 6 val m 阅读全文
posted @ 2022-01-19 21:03 靠谱杨 阅读(122) 评论(0) 推荐(0)
摘要: 1 package chapter07 2 3 import scala.collection.mutable 4 5 object Test07_MutableSet { 6 def main(args: Array[String]): Unit = { 7 // 1. 创建setmutable. 阅读全文
posted @ 2022-01-19 12:03 靠谱杨 阅读(418) 评论(0) 推荐(0)
摘要: 1 package chapter07 2 3 object Test06_ImmutableSet { 4 def main(args: Array[String]): Unit = { 5 // 1. 创建set 直接使用括号() apply的作用 6 val set1 = Set(13, 23 阅读全文
posted @ 2022-01-19 12:01 靠谱杨 阅读(75) 评论(0) 推荐(0)
摘要: 1 package chapter07 2 3 import scala.collection.mutable.ListBuffer 4 5 object Test05_ListBuffer { 6 def main(args: Array[String]): Unit = { 7 // 1. 创建 阅读全文
posted @ 2022-01-19 11:49 靠谱杨 阅读(109) 评论(0) 推荐(0)
摘要: 1 package chapter07 2 3 object Test04_List { 4 def main(args: Array[String]): Unit = { 5 // 1. 创建一个List 6 val list1 = List(23, 65, 87) 7 println(list1 阅读全文
posted @ 2022-01-19 11:45 靠谱杨 阅读(68) 评论(0) 推荐(0)