It’s been a while since my data structures class and I’m having a hard time figuring this one out. I know that if I want to get the value from an ArrayList of Object[] I can use
nameOfArrayList.get(row)[col];
but I can’t seem to figure out, or find on the web, how to set a value.
Would I have to create a new object and set it to nameOfArrayList.get(row), alter the value and then use
nameOfArrayList.set(row,Object[])?
Try this:
This sets a new value at index
colof the array at indexrowin thenameOfArrayArrayList.If you want to put a new array into
nameOfArrayat positionrow, try this:This creates a new array of objects and puts it under index
rowinnameOfArray. SeeArrayList.set().