0
What is the problem in this code?
fun main(args: Array<String>) { var age = readLine()!!toInt() when { age<0 -> println("Invalid Age") age<=11 -> println("Child") age<=17 -> println("Teen") age<=64 -> println("Adult") else -> println("Senior") } }
2 Answers
+ 3
You forgot a period in the between the not-null assertion characters and the toInt method. It should be readLine()!!.toInt()
+ 2
Thnx for your help