List: set(int index, T element)
import java.util.Arrays;
import java.util.List;
public class Main {
public static void main(String[] a) {
List<String> list = Arrays.asList(new String[] { "A", "B", "C", "D" });
list.set(2, "X");
System.out.println(list);
}
}
Related examples in the same category