PartialFunction(偏函数)

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

    println(one(3))

 

posted @ 2015-09-08 22:46  yshy  阅读(290)  评论(0编辑  收藏  举报