Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Sunil Garg   on Apr 01 In Java Category.

  
Question Answered By: Taylor White   on Apr 01

Yes, by the given code the file  is always reset, because the FileWriter
constructor you use. You shoud change your code like this::

..... .... new FileWriter( filename  + "a", true);

This will append the file, i.e, open  and position the file pointer at the next
free line available.

You should also consult Java Documentation for help in constructors and IO
functions, or, you can better use an IDE like SUNONE Studio for auto code
completion and hints.

Share: 

 

This Question has 1 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Problems with IO Or get search suggestion and latest updates.


Tagged: