import java.util.*; public class Alice2 { public Alice2() { // Fill the ArrayList. ArrayList battle = new ArrayList(); for (int i = 0; i < 100; i++) { if (Math.random() < 0.5) { battle.add("Tweedledum"); } else { battle.add("Tweedledee"); } } // Delete one String type. String[] battleArray = battle.toArray(new String[0]); // Get the ArrayList as a copied array. for (String person: battleArray) { // Loop through this. if (person.equals("Tweedledum")) { battle.remove(person); // But delete from the original. } } // Test. // Note, just to show you an alternative, the following uses a while loop // and a data structure called an Iterator, which you can get from an ArrayList. Iterator si = battle.iterator(); String temp = null; while (si.hasNext()) { temp = si.next(); System.out.println(temp); } } public static void main (String args[]) { new Alice2(); } }