摘要:
1 package chapter08 2 3 object Test03_MatchTupleExtend { 4 def main(args: Array[String]): Unit = { 5 // 1. 在变量声明时匹配 6 val (x, y) = (10, "hello") 7 pri 阅读全文
摘要:
1 package chapter08 2 3 object Test02_MatchTypes { 4 def main(args: Array[String]): Unit = { 5 // 1. 匹配常量 6 def describeConst(x: Any): String = x matc 阅读全文
摘要:
1 package chapter07 2 3 object Test18_ComplexWordCount { 4 def main(args: Array[String]): Unit = { 5 val tupleList: List[(String, Int)] = List( 6 ("he 阅读全文
摘要:
1 package chapter07 2 3 object Test17_CommonWordCount { 4 def main(args: Array[String]): Unit = { 5 val stringList: List[String] = List( 6 "hello", 7 阅读全文
摘要:
1 package chapter07 2 3 object Test15_HighLevelFunction_Reduce { 4 def main(args: Array[String]): Unit = { 5 val list = List(1,2,3,4) 6 7 // 1. reduce 阅读全文
摘要:
1 package chapter07 2 3 object Test14_HighLevelFunction_Map { 4 def main(args: Array[String]): Unit = { 5 val list = List(1,2,3,4,5,6,7,8,9) 6 7 // 1. 阅读全文