/** This is the 2nd program to run -- the reader. Once we have a * shopping list created and stored in a file shoppinglist.txt, * we can read that list and put it into our own Vector. Then * we'll print it out. */ import java.io.*; import java.util.*; public class Reader { public static void main(String [] args) throws IOException, FileNotFoundException, ClassNotFoundException { ObjectInputStream in = new ObjectInputStream (new FileInputStream("shoppinglist.txt")); Vector list = (Vector) in.readObject(); in.close(); for (int i = 0; i < list.size(); ++i) { System.out.println(list.elementAt(i)); } } }