0
Why this code isnt working? Everything is ok, but after else, idk why code in not working.
fun main() { var mNumber = 1 when (mNumber) { 1 -> println("this is 1") 2 -> println("this is 2") } else -> { println("this is not 1 or 2") } }
1 Answer
+ 1
put the else inside the brackets as you did for 1 and 2