Possible Duplicate:
Explicitly assigning values to a 2D Array?
sorry if this has been addressed before. I did a search and couldn’t find anything:
Is there any way to instantiate a 2D array in Java with values like in the manner of a 1D array. For example, is there a way to do this:
int[] oneD = {1, 2, 3};
for this:
int[][] twoD = ...?
Thanks for the help.
You can do it like that: