package cn
.zy
;
public class Test2DimensionArray {
public static void main(String
[] args
) {
int[][] b
=new int[3][];
b
[0]=new int[] {20,30,10};
b
[1]=new int[] {50,60,70};
b
[2]=new int[] {25,35,45};
int[][] c
= {{1,2,3},{2,1,3}};
int[][] d
=new int[5][];
for(int i
=0;i
<d
.length
;i
++) {
d
[i
]=new int[i
+3];
for(int j
=0;j
<d
[i
].length
;j
++) {
d
[i
][j
]=i
+j
;
}
}
System
.out
.println(b
[0][0]);
System
.out
.println(c
[0][0]);
System
.out
.println(d
[0][2]);
}
}
转载请注明原文地址: https://mac.8miu.com/read-497353.html