Scala's match matching basic code


//scala match匹配
object mohsi {
    
    
  def main(args: Array[String]): Unit = {
    
    
    def is(a:String) = a match {
    
    
        case "wzh" => println("han han")
        case "jhk" => println("666")
        case "ydl" => println("no no no")
        case "UV" =>println("low low low")
        case _ =>println("remake")
    }
    is("wzh")
  }
}

Guess you like

Origin blog.csdn.net/qq_45750230/article/details/107684739