“Scala Match” Code-Antworten

Scala Match Standard

something match {
    case "val" => "found match!!"
    case _ => "default case"
}
z0san

Scala Match

val x: Int = Random.nextInt(10)

x match {
  case 0 => "zero"
  case 1 => "one"
  case 2 => "two"
  case _ => "other"
}
z0san

Ähnliche Antworten wie “Scala Match”

Fragen ähnlich wie “Scala Match”

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen