This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes I/O and Streams and the fly likes write to a file without delete it (noob question) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "write to a file without delete it (noob question)" Watch "write to a file without delete it (noob question)" New topic
Author

write to a file without delete it (noob question)

Quiddo Quitch
Ranch Hand

Joined: Apr 21, 2008
Posts: 38
i have this simple code, who writes "hello world" into a text file ...

what can i do if i want to write a NEW "hello world" everytime i run this code, without deleting the old "hello world" ... ?



thanks !
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19674
    
  18

Check out the java.io.FileWriter constructors.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Quiddo Quitch
Ranch Hand

Joined: Apr 21, 2008
Posts: 38
perfect !! thanks for make me learn
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: write to a file without delete it (noob question)