001package serialization.fixedJavaSoftExample; 002import java.io.*; 003 004public class CardReader { 005 public static void main(String[] args) { 006 Card2 card = null; 007 008 try { 009 FileInputStream in = new FileInputStream("card.out"); 010 ObjectInputStream ois = new ObjectInputStream(in); 011 card = (Card2)(ois.readObject()); 012 ois.close(); 013 } catch (Exception e) { 014 System.out.println("Problem serializing: " + e); 015 } 016 017 System.out.println("Card read is: " + card); 018 019 } 020}