You get a ArrayIndexoutofBoundsExeption upon accessing array2D[1] because the length of array2D is 1. It has only one element, which is accessed through array2D[0].
array2D[0] points to an array of 2 elements i.e. { 1, 2 }. That is why when you do array2D[0][0], you get 1, and when you do array2D[0][1], you get 2.