nExemplo: Salvando data em arquivo
n
FileOutputStream out= new FileOutputStream("theTime");
n
ObjectOutputStream s = new ObjectOutputStream(out);
n s.writeObject("Today");
s.writeObject(new Date()); s.flush(); out.close();
nExemplo: Recuperando data do arquivo
n
FileInputStream in = new FileInputStream("theTime");
n
ObjectInputStream s = new ObjectInputStream(in);
n String
today=(String)s.readObject(); Date date=(Date)s.readObject();in.close();