First of all, the definition of a two-dimensional array in Java is as follows:
int[][] arr = new int[3][2];
This means that a two-dimensional array of int type is defined.
There are three one-dimensional arrays in the array, and each one-dimensional array has two elements.
.
.
.
Yet another definition of a two-dimensional array
int[][] arr = new int[3][];
This defines that there are three one-dimensional arrays in the array, but the elements in the array are uncertain and need to be defined again
:
int[][] arr = new int[3][];
这个分别对数组中的小数组进行初始化
int[0] arr = new int[3];
int[1] arr = new int[2];
int[2] arr = new int[4];
Image link : Baidu Cloud