在Java中创建二维数组的方式有以下几种:
int[][] array = new int[3][4];
int[][] array = { {1, 2, 3}, {4, 5, 6}, {7, 8, 9} };
int[][] array = new int[3][];
array[0] = new int[4];
array[1] = new int[4];
array[2] = new int[4];
int[][] array = new int[3][4];
for (int i = 0; i < array.length; i++) {
for (int j = 0; j < array[i].length; j++) {
array[i][j] = i * j;
}
}