posted 11 years ago
Hi Harini,
Welcome to CodeRanch!
Firstly, why are you using ArrayList? If you are generating output which is to be dumped in a file, it makes much sense to use StringBuilder etc. instead of ArrayList.
Secondly, if you are writing ArrayList object itself by using serialization mechanism (writeObject method), then it writes the actual object to file, which might not be readable by simply opening the file (i.e. the ArrayList is not written in text format). If you want to read it, you'll need to use readObject method.
If you simply want to write the text, then no need to go for serialization.
I hope this helps.
Regards,
Anayonkar Shivalkar (SCJP, SCWCD, OCMJD, OCEEJBD)