public class study5 {
public static void main(String args[]) {
int[][] number = new int[4][];
number[0] = new int[3];
number[1] = new int[2];
number[2] = new int[3];
number[3] = new int[2];
number[0][0] = 10;
number[0][1] = 11;
number[0][2] = 12;
number[1][0] = 20;
number[1][1] = 21;
number[2][0] = 30;
number[2][1] = 31;
number[2][2] = 32;
number[3][0] = 40;
number[3][1] = 41;
for(int i = 0; i<number.length; i++){
for(int b=0; b<number[i].length; b++){
System.out.print(number[i][b]+" ");
}
System.out.println("");
}
}
}
출력결과:
10 11 12
20 21
30 31 32
40 41
반응형