Check the code

Report a typo

Examine the following code snippet:

fun checkTheCode(input: String) {
    var result = input.toBoolean() // 1
    result = !result               // 2
    val output = result.toString() // 3
    println(output)                // 4
}

Enter the number of the line that may throw an exception.

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