import java.io.FileOutputStream; import java.io.ObjectOutputStream; public class CerealOut { public static void main(String[] args) throws Exception { FileOutputStream fos = new FileOutputStream("people"); ObjectOutputStream oos = new ObjectOutputStream(fos); oos.writeObject(new Person(21, "Erik", "Wright")); oos.writeObject(new Person(20, "Joseph", "Hashmall")); oos.writeObject(new Person(39, "Samuel", "Rebelsky")); oos.close(); } }