匹配 变量的类型
package test_35 //匹配 变量的类型 object test4 { def main(args: Array[String]): Unit = { val i = 1 val j:Double =1.2 val b: Boolean = false val x:Any = b x match { case _:Int => println(s"当前是Int") case _:Double => println(s"当前是Double") case a:Boolean => println(s"当前是Boolean $a") case _ => println("其他") } } }