✏️ Explanatory Question
// • • •
vals[18] = 10;
catch (ArrayIndexOutOfBoundsException exc) {
// handle error
}
The error is that there is no try block before the catch statement.
A catch block must follow a try block, otherwise the compiler will throw an error.
The corrected code should be: