As you learned earlier, arrays have a type constructor nature, meaning any existing type can be used to create another array type (a recursive definition, that is). So, what about arrays of arrays? Sure enough, that works:
int vectors = new int;
An array with elements that are arrays by themselves is called a jagged array.
In the preceding example, we’re creating an array of integer arrays and specifying the number of such arrays we want. The
vectors array contains arrays by itself, which are reference types. So, right after the creation of the jagged array, it contains null references for the elements. Next, we can initialize those elements as follows:
vectors = new int;vectors = new int;vectors = new int; ...