Leave a Reply 4

Your email address will not be published. Required fields are marked *


bob

bob

This code does not compile, the code should be read :

System.out.println( array[4][1] );
System.out.println( array[1][4] );

before answering the question.

pojo

pojo

public static void main(String[] args) {

int [][] arr={{0},{0,1}, {0,2,4},{0,3,6,9},{0,4,8,12,16}};
System.out.println( arr[4][1] );
System.out.println( arr[1][4] );
}

it’s well for me

Fredy Benavides

Fredy Benavides

Perhaps Bob is talking about the extra parenthesis in the third line

Allen

Allen

First prints 4
System.out.println( array[4][1] );

second line
no extra parenthesis will be Exception
System.out.println( array[1][4] );

D