Consider the following scenario.
List list = new ArrayList<>();
Now I added the String values for this li
String
If you want to replace items in your List, I would go old school with a for loop
for (int nIndex=0; nIndex < list.size(); nIndex++) { Obj obj = (Obj) list.get(nIndex); // update list item list.set(nIndex, obj2); }