I have to create a 2d array with unknown size. So I have decided to go with a 2d ArrayList the problem is I\'m not sure how to initialize such an array or store information.
The short answer to the followup question is
array.get(i1).put(i2, value);
but both the get and put could fail if the size of the ArrayList is <= the index. So if you want to be able to fill in arbitrary values, you need to write methods to expand as necessary. The call would then be something like
putCell(getRow(array, i1), i2, value)
where getRow() knows how to grow the ArrayList of ArrayList, and putCell() knows how to grow the ArrayList.