Where is an exception

Report a typo

Examine the following code snippet:

val s = "ten"     // 1
var n = s.toInt() // 2
println(n)        // 3
n += 20           // 4
println(n)        // 5

Enter the number of the line that will throw a NumberFormatException.

If you think that each line is OK and the code is correct, enter "0"

Enter a number

Create a free account to access the full topic