What is the output of the following code?
int test = new int; test = 1; test = 7;
// index 3 is not between 0 and 2. At runtime, an exception is thrown. test = 7;
At runtime, Java checks array bounds for every access to an array element.
If the array bounds are exceeded, an java.lang.ArrayIndexOutOfBoundsException is thrown.