-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathThreeDMatrix.java
More file actions
33 lines (27 loc) · 831 Bytes
/
ThreeDMatrix.java
File metadata and controls
33 lines (27 loc) · 831 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
package chapter3;
public class ThreeDMatrix {
public static void main(String[] args) {
/*The followings both are true declarations*/
int[] a = new int[4];
int b[] = new int[4];
int [] d,e,f,g;
int m[],s[],y[];
int threeD[][][] = new int[3][4][5];
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 4; j++) {
for (int k = 0; k < 5; k++) {
threeD[i][j][k] = i * j * k;
}
}
}
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 4; j++) {
for (int k = 0; k < 5; k++) {
System.out.print(threeD[i][j][k] + " ");
}
System.out.println();
}
System.out.println();
}
}
}