Serializing an Object The object to be serialized must implement java.io.Serializable. try { ObjectOutputStream out = new ObjectOutputStream( new FileOutputStream("filename.ser")); out.writeObject(object); out.close(); } catch (IOException e) { }