Editing the contents of an array list

how you can edit the contents of a list of arrays using the value generated by the user using the scanner class.

many thanks

+3
source share
1 answer
List<String> lst = new ArrayList<String>();
lst.add("a");
lst.add("b");
lst.add("c");

//now modifying contents
lst.set(1, "z");
+8
source

Source: https://habr.com/ru/post/1777751/


All Articles