import java.io.ObjectOutputStream; import java.io.FileOutputStream; public class TestPeople { public static void main(String[] args) throws Exception { People cs153 = new People(); cs153.add(new Person(21, "Erik", "Wright")); cs153.add(new Person(20, "Joe", "Hashmall")); System.out.println(cs153); FileOutputStream fos = new FileOutputStream("people"); ObjectOutputStream oos = new ObjectOutputStream(fos); oos.writeObject(cs153); oos.writeObject(new Person(39, "Samuel", "Rebelsky")); oos.writeObject(new Person(19, "Saul", "St. John") { public String toString() { return "Hello"; } }); oos.close(); } // main(String[]) } // class TestPeople