Kotlin - Control Flow as Expressions
What will this Kotlin code print?
val result = when (2) {
1 -> "One"
2 -> "Two"
else -> "Other"
}
println(result)val result = when (2) {
1 -> "One"
2 -> "Two"
else -> "Other"
}
println(result)15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions