2d Arrays & Nested Loops
Lesson 23Author : GOUP
Last Updated : September, 2020
Code
// int [][] numberGrid = new int[2][3];
int [][] numberGrid = { {1, 2}, {3, 4} };
numberGrid[0][1] = 99;
System.out.println(numberGrid[0][0]);
System.out.println(numberGrid[0][1]);
for(int i = 0; i < numberGrid.length; i++){
for(int j = 0; j < numberGrid[i].length; j++){
System.out.println(numberGrid[i][j]);
}
System.out.println();
}