-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMultiDimension.java
35 lines (27 loc) · 936 Bytes
/
MultiDimension.java
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
34
35
import java.util.Arrays;
public class MultiDimension {
public static void main(String[] args) {
int [][] arr = new int[3][];
int [][] arr2D = {
{ 123,2414,41,}, // oth index -> arr2D
{14,415,4,34,6}, // 1st index -> arr2D
{346,347,723,2} // 2nd index -> arr2D [] = ( 346,347,723,2 )
};
System.out.println(Arrays.deepToString(arr2D));
System.out.println(arr.length);
int [] [] ar = {
{ 23, 2, 25},
{ 32, 237},
{ 23, 10,23}
};
System.out.println(Arrays.toString(ar));
for (int[] ints : arr) {
for (int col = 0; col < ints.length; col++) {
}
System.out.println();
}
for ( int rows = 0; rows < arr.length; rows++){
System.out.println(Arrays.toString(arr[rows]));
}
}
}