I need to implement a 2D dynamic array. The number of rows is fixed, say n. But the number of columns for each row is not fixed and equivalent. For instance, the first row h
You can either use a array for the rows since this dimenstion is fixed:
@SuppressWarnings("unchecked") ArrayList[] arr = new ArrayList[ fixedsize];
or use nested ArrayLists:
List> list = new ArrayList>( fixedsize );