import java.io.*; import java.awt.Point; public class LoadObject { public static void main (String[] args) { Point anObject = null; FileInputStream file; ObjectInputStream defreezer; // load first object contained in external file "point.ser" try { file = new FileInputStream("point.ser"); defreezer= new ObjectInputStream(file); anObject = (Point) defreezer.readObject(); defreezer.close(); } catch (IOException noIO) { System.out.println("IO error occurred: " + noIO); } catch ( ClassNotFoundException unknownClass ) { System.out.println("Serialized object is of unknown type: " + unknownClass); } // show what we defrosted System.out.println("Original object : " + anObject); } } // End of Class LoadObject