new_array_access.mj 341 Bytes
Newer Older
Joshua Bachmeier's avatar
Joshua Bachmeier committed
1 2 3 4 5 6 7 8 9
class NewArrayAccess {
    public static void main(String[] args) {
        /*
         * In Java, this is invalid, since this creates a new 2D array (which is not the type of x)
         * In MiniJava, this is valid, because this creates a new array of size 5 and access the first element
         */
        int x = new int[5][1];
    }
}