public void readObject(ObjectInputStream os) { System.out.println("invoke the readObject..."); try { os.defaultReadObject(); // s = (String)os.readObject(); } catch (IOException e) { e.printStackTrace(); } catch (ClassNotFoundException e) { e.printStackTrace(); } }
public Apple readApple(FileInputStream is) { Apple a = null; try { ObjectInputStream ois = new ObjectInputStream(is); a = (Apple)ois.readObject(); ois.close(); } catch(Exception e) { e.printStackTrace(); } return a; }