A
anon0ne
Hello I am making a 2D array however I am wondering what is wrong with the
following syntax.
int[][] parameters = new int[7][5];
parameters[0] = new int[] {1,2,3,4,5};
parameters[1] = new int[] {2,3,4,5,6};
....
I know I could use the following to create the same thing:
int[][] parameters = {{1,2,3,4,5},....,{7,8,9,10,11}};
to get the same effect but I would rather use the initial syntax for what I
am trying to do.
Is there a way where I can achieve this?
thank you for any advice.
following syntax.
int[][] parameters = new int[7][5];
parameters[0] = new int[] {1,2,3,4,5};
parameters[1] = new int[] {2,3,4,5,6};
....
I know I could use the following to create the same thing:
int[][] parameters = {{1,2,3,4,5},....,{7,8,9,10,11}};
to get the same effect but I would rather use the initial syntax for what I
am trying to do.
Is there a way where I can achieve this?
thank you for any advice.