A basic example of an ArrayList. Along with adding and removing Strings.
public static void main(String[] args) {
ArrayList <String> people = new ArrayList < String> ();
people.add("Dave");
people.add("Andrew");
people.add("John");
for (int i=0; i<people.size(); i++) {
System.out.println(people.get(i));
}
System.out.println("");
people.remove("Dave");
people.add("Steve");
for (int i=0; i<people.size(); i++) {
System.out.println(people.get(i));
}
}
/* OUTPUT:
Dave
Andrew
John
Andrew
John
Steve
*/