Skip to content
Quiz · Arrays · lesson 2 of 8

Quiz — an index out of bounds

What happens when this program is compiled and run?

JAVA
public class Main {
    public static void main(String[] args) {
        int[] a = {1, 2, 3};
        System.out.println(a[3]);
    }
}