A jagged array is an array whose elements are arrays. The elements of a jagged array can be of different dimensions and sizes. A jagged array is sometimes called an “array of arrays.” The following examples show how to declare, initialize, and access jagged arrays.

The following is a declaration of a single-dimensional array that has three elements, each of which is a single-dimensional array of integers:

int[ ][ ] jaggedArr = new int[3][ ];

Each dimension is an array, so you can also initialize the array upon declaration like this:

int[ ][ ] jaggedArr = new int[ ][ ]
{
new int[ ] {1,8,2,7,9},
new int[ ] {2,4,6},
new int[ ] {33,42}
};

You can access individual array elements as shown in the example below:

The Code:

New Project169

The Output of Your Program:

New Project168

This accesses the second element of the third array.

jagged array is an array-of-arrays, so an int[ ][ ] is an array of int[ ], each of which can be of different lengths and occupy their own block in memory.
A multidimensional array (int[,]) is a single block of memory (essentially a matrix). It always has the same amount of columns for every row.