Shows How To Save A Date Object To A File

Shows How To Save A Date Object To A File


  • 9 Dec, 2011

    Code Sample 1: SaveDate.javaimport java.io.*;import java.util.Date;public class SaveDate {public static void main(String argv[]) throws Exception { FileOutputStream fos =new FileOutputStream("date.out");ObjectOutputStream oos = new ObjectOutputStream(fos); Date date = new Date(); oos.writeObject(date); oos.flush(); oos.close(); fos.close(); }}

    Comments Received:
    Please give your suggestions and feedback:

2009-2016 downloadmela.com. All rights reserved.