9 Answers
9

The difference here is that the first sample, int[][] creates a jagged array, while the second creates a multidimensional array (of dimension 2). In a jagged array each "column" can be of a different size. In a true multidimensional array, each "column" (in a dimension) is the same size. For more complete information see the Array section of the C# Programming Guide.

int[][] is an array of arrays or "jagged" array: you can use this when you want different sizes in the second dimension. For example, the first sub array can have 5 elements and the second can have 42.

int[,] is a two dimensional array: The second dimension is the same through out the array. With int[7, 42] the second dimension is 42 for all 7 lines.

As you can see the second one is a bit more involved because you need the for-loop to fully create it. It is often called a jagged array because the 2nd order arrays do not need to be all of the same length.

One thing to consider about a jagged array is that you are allocating non-contiguous chunks of memory. This is a good thing if you have a large array of large objects. I've seen SomeThing[n,n] create StackOverflow issues, but SomeThing[n][n] be ok.