1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: |
class Rei8_2_1{
public static void main(String[] args){
int[][] arr = {
{1, 2, 3, 4, 5, 6},
{7, 8, 9, 10, 11, 12}
};
for (int i=0;i<arr.length;i++){
for (int j=0; j<arr[i].length; j++){
System.out.print(arr[i][j] + " ");
}
System.out.println("");
}
}
}
|
| 1 | 2 | 3 | 4 | 5 | 6 |
| 7 | 8 | 9 | 10 | 11 | 12 |
| [0][0] | [0][1] | [0][2] | [0][3] | [0][4] | [0][5] |
| [1][0] | [1][1] | [1][2] | [1][3] | [1][4] | [1][5] |