-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathThreeDarray.java
More file actions
33 lines (28 loc) · 794 Bytes
/
ThreeDarray.java
File metadata and controls
33 lines (28 loc) · 794 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
public class ThreeDarray {
public static void main(String[] args) {
int[][][] arr = {
{
{1, 2, 3},
{4, 5, 6}
},
{
{7, 8, 9},
{10, 11, 12}
},
{
{13, 14, 15},
{16, 17, 18}
}
};
for (int i = 0; i < arr.length; i++) {
System.out.println("Block" + i + " ");
for (int j = 0; j < arr[i].length; j++) {
for (int k = 0; k < arr[i][j].length; k++) {
System.out.print(arr[i][j][k] + " ");
}
System.out.println();
}
System.out.println();
}
}
}