摘要:
1、匹配对象 1 object Test4_MatchObject { 2 def main(args: Array[String]): Unit = { 3 val student = new Student("wl", 22) 4 5 //针对对象实例的内容进行匹配 6 val result = 阅读全文
摘要:
1 object Test2_MatchTypes { 2 def main(args: Array[String]): Unit = { 3 //1、匹配常量 4 def describeConst(x: Any): String = x match { 5 case 1 => "Num one" 阅读全文