Question : scala match
Answered by : z0san
val x: Int = Random.nextInt(10)
x match { case 0 => "zero" case 1 => "one" case 2 => "two" case _ => "other"
}
Source : | Last Update : Wed, 23 Mar 22
Answered by : z0san
val x: Int = Random.nextInt(10)
x match { case 0 => "zero" case 1 => "one" case 2 => "two" case _ => "other"
}
Source : | Last Update : Wed, 23 Mar 22