📜  arraylist 替换值 java 代码示例

📅  最后修改于: 2022-03-11 14:52:07.843000             🧑  作者: Mango

代码示例1
list.set(1,"new value");

//example ..

List 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]