This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread 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 OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP 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: 19726
    
  20

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
 
Don't get me started about those stupid light bulbs.
 
subject: write to a file without delete it (noob question)