Check out example codes for "arraylist replace value java". It will help you in understanding the concepts better.

Code Example 1

list.set(1,"new value");

//example ..

List<String> list = new ArrayList<>();
list.add("one");
list.add("two");
list.add("three");
System.out.println(list); // [one,two,three]
list.set(1,"new");
System.out.println(list); //[one,new,three]

Learn ReactJs, React Native from akashmittal.com