Arrays Can Be Jagged
In languages like C and C++, each subarray of a multidimensional array must have the same dimensions.
在C和C++语言中,多维数组的子数组必须要有相同的维数。
In Java and C# arrays do not have to be uniform because jagged arrays can be created as one-dimensional arrays of arrays. In a jagged array the contents of the array are arrays which may hold instances of a type or references to other arrays.
在Java和C#中,数组不一定要一致,因为交错数组能被生成作为一维数组的数组。
在交错数组中,数组的内容是数组,它们里面容纳一个类型的很多实例或引用其他数组。
例子:
int [][]myArray = new int[2][];
myArray[0] = new int[3];
myArray[1] = new int[9];