java 定义三维数组,有很多方法,这里举两种:
1.直接定义法,直接定义三维
?int a[][][] = new int[1][1][1];
2.二维转三维,先定义若干二维,再直接填充进三维中.
?public final static int[][] a0 = {
???{ 0, 1, 2}, {3,4,5}, {4,6,7} };
?public final static int[][] a1 = {
???{ 0, 4, 6,}, {6, 8, 8, 6}, {8, 8, 6, 12, 14, 4, 4, 0} };
?public final static int[][][] as = {a0,a1?};