java - How do I replace an item in an array in an arraylist? -
i have arraylist, initialized follows:
public static list<int[]> items = new arraylist<int[]>();
i add items this:
items.add(new int[] {2,0,1,0,1});
can change specific entry on array on arraylist (for example: 2 @ index 0), or have recreate array every time items.set()
?
you can this:
int[] array = items.get(0); array[0] = <new value>;
Comments
Post a Comment