Sunday, 8 September 2013

How to modify only one column value in Java ArrayList?

How to modify only one column value in Java ArrayList?

ArrayList<Student> studentArray = new ArrayList<Student>();
studentArray.add(new Student("Nick", "18", "1st Street"));
studentArray.add(new Student("John", "22", "2st Street"));
studentArray.add(new Student("Anthony", "19", "3rd Street"));
How to modify 2nd row's address only? I want to change 1st Street to 2nd
Street, but I want to keep John and 22 same as before.
2nd row, 3rd item.

No comments:

Post a Comment