Chris
Chris

Reputation: 211

editing the contents of an array list

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

many thanks

Upvotes: 5

Views: 9368

Answers (1)

Jigar Joshi
Jigar Joshi

Reputation: 240860

List<String> lst = new ArrayList<String>();
lst.add("a");
lst.add("b");
lst.add("c");

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

Upvotes: 10

Related Questions