// Program start method.
public static void main(String[] args) {
String[][] array2D = new String[10][10]; // Create 2D array.
for (int row = 0; row < array2D.length; row++) { // Loop through the rows in the 2D array.
for (int col = 0; col < array2D[row].length; col++) { // Loop through the columns in the 2D array.
array2D[row][col] = "row: " + row + ", column: " + col; // Set the data in the right row and column.
}
}
}
public static void main(String[] args) {
int[][] array = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
for(int[] count : array) {
for(int elem : count) {
System.out.print(elem + " "); //output: 1 2 3 4 5 6 7 8 9
}
}
}