二维数组理解图例
示例
int[][][] nums = new int[2][2][2];
Random random = new Random();
for (int[][] num : nums) {
for (int[] ints : num) {
for (int i = 0; i < ints.length; i++) {
// 生成100以内的随机数
ints[i] = random.nextInt(100);
}
}
}
for (int[][] num : nums) {
for (int[] ints : num) {
for (int anInt : ints) {
System.out.println(anInt);
}
}
}