在下面的图中包含我要创建如何在java中创建3D数组?
我有5个航班与数字777,747,777,747
和777
三维阵列的结构。
我想创建一个二维数组大小5*3
如果飞行= 777 与大小10*5
一个二维数组,如果飞行= 747
int seat[][][] = new int [5][][];
int flight = 0;
while (flight < 5) {
if (Boeing_Number[flight] == 777) {
seat = new int[flight][5][3];
}
else if (Boeing_Number[flight] == 747) {
seat = new int[flight][10][5];
System.out.println(" created ");
}
flight++;
}
[在Java中初始化多维数组]可能的副本(http://stackoverflow.com/questions/1067073/initialising-a-multidimensional-array-in-java) –