我可以通过第一种方法将值分配给二维数组,但不能通过第二种方法。为什么?
// First way (does work)
int[][] arr_2_dem_1 = new int[3][];
arr_2_dem_1[0] = new int[]{1,2};
arr_2_dem_1[1] = new int[]{3,4};
arr_2_dem_1[2] = new int[]{4,5,6};
// Second way (does not work)
int[][] arr_2_dem = new int[3][4];
arr_2_dem[0] = {1,2,3,4};
arr_2_dem[1] = {3,4,5,6};
arr_2_dem[2] = {4,5,6,7};