how to loop through every element in a 2D array code example
Example: how to use loop in 2d array
for (int row = 0; row < board.length; row++) {
for (int col = 0; col < board[row].length; col++) {
board[row][col] = row * col;
}
}