Answers for "program to replace 2nd element of arraylist with the specified element in java"

2

arraylist replace value java

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]
Posted by: Guest on August-07-2020

Code answers related to "program to replace 2nd element of arraylist with the specified element in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language