Question #146462

which of the following is a best way of declaring x as a two-dimension array in java?
a.int[2] x = new int[];
b.int[]x = new int[2];
c.int[10][20] x = new int[20][10];
d.int[][] x = new int[10][20];

Expert's answer

A two-dimensional array in java can be declared as follows: int[][] x = new int[10][20];

Therefore, the answer is d).

Answer:

d. int[][] x = new int[10][20]


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS