Stack frame line

Report a typo

Read the following code carefully:

fun main() {
    val demoArray = intArrayOf(0, 1, 2, 3, 4, 5)
    println(demoArray[10])
}

If you run it, the application will throw an error, with the first line displaying this message:

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 10 out of bounds for length 6

What will this line be followed by?

Select one option from the list
___

Create a free account to access the full topic