int[][] array = {
{1, 2, 3},
{4, 5, 6},
{7, 8, 9}
};
int[][] array = new int[3][3]; // 定义一个3行3列的二维数组
// 给二维数组赋值
array[0][0] = 1;
array[0][1] = 2;
array[0][2] = 3;
array[1][0] = 4;
array[1][1] = 5;
array[1][2] = 6;
array[2][0] = 7;
array[2][1] = 8;
array[2][2] = 9;
int[][] array = new int[3][]; // 定义一个3行的不规则二维数组
array[0] = new int[2];
array[1] = new int[3];
array[2] = new int[4];
// 给不规则二维数组赋值
array[0][0] = 1;
array[0][1] = 2;
array[1][0] = 3;
array[1][1] = 4;
array[1][2] = 5;
array[2][0] = 6;
array[2][1] = 7;
array[2][2] = 8;
array[2][3] = 9;