PartialFunction(偏函数)

val one:PartialFunction[Int,String]={
      case 1 => "one"
      case 2 => "two"
      case _ => "other numbers"
    }

    println(one(3))
原文地址:https://www.cnblogs.com/yshyee/p/4793201.html