How do I update the element at a certain position in an ArrayList?
Let arrList
be the ArrayList
and newValue
the new String
, then just do:
arrList.set(5, newValue);
This can be found in the java api reference here.
list.set(5,"newString");
- Reference