What is the correct way to declare a multidimensional array and assign values to it?
This is what I have:
int x = 5; int y = 5; String[][] myStringA
int[][] myNums = { {1, 2, 3, 4, 5, 6, 7}, {5, 6, 7, 8, 9, 10, 11} }; for (int x = 0; x < myNums.length; ++x) { for(int y = 0; y < myNums[i].length; ++y) { System.out.print(myNums[x][y]); } }
Output
1 2 3 4 5 6 7 5 6 7 8 9 10 11