I want to do 2D dynamic ArrayList example:
[1][2][3] [4][5][6] [7][8][9]
and i used this code:
ArrayList
Use
group.add(new ArrayList(Arrays.asList(1, 2, 3)));
The ArrayList has a Collection parameter in the constructor.
Collection
If you define the group as
group
List> group = new ArrayList<>(); group.add(Arrays.asList(1, 2, 3));