import java.io.*;
import java.util.*;
class SerDatef
public static void main(String[] args) throws Exception{
GregorianCaiendar d - new GregorianCaiendar();
QbjectOutputStream oos = new ObjectOutputStream{
new FileOutputStream("date.ser"));
oos.writeObject(d);
oos.flush();
oos.close();
Thread.sleep(3000);
ObjectlnputStream ois = new ObjectlnputStream(
new FileInputStream("date.ser"));
GregorianCaiendar oldDate = (GregorianCaiendar)ois.readObject();
ois.close();
GregorianCaiendar newDate = new GregorianCaiendar();
System.out.println("Old time = " +
oldDate.get(Calendar.HOUR) + ":" +
oldDate.get(Calendar.MINUTE) +":" +
oldDate.get(Calendar.SECOND) +"\nNew time = " +
newDate.get(Calendar.HOUR) +":" +
newDate.get(Calendar.MINUTE) +":" +
newDate.get(Calendar.SECOND));
}
}