In serialization, normally flush is not used. But its better to use flush because its a security measure that is taken to ensure that any data remaining on the stream is written on the file. close() does the same thing but it is not meant to check the streams properly.
flush() is basically used when we write to files. Before closing the file we flush all the data.
[ SCJP 6.0 - 90% ] , JSP, Servlets and Learning EJB.
Try out the programs using a TextEditor. Textpad - Java 6 api