Limited access

Upgrade to access all content for this subject

Consider the following code.

public static void main(String args[])

{
    int numArray[][]={{3,5,7},{2,4,6},{9,8,7},{6,5,4}};

    if (numArray.length==4)
    {

        for (int i=0; i<numArray[0].length; i++)
        {
            System.out.print(numArray[i][2]);
        }
    }
    else
    {
        for(int i=2; i>-1; i--)
        {
            System.out.print(numArray[2][i]);
        }
    }    
}

What is printed as a result of executing the code?

A

767

B

OutOfBoundsException

C

548

D

987

E

246

Select an assignment template