• Post Reply Bookmark Topic Watch Topic
  • New Topic

write to a file without delete it (noob question)  RSS feed

 
Quiddo Quitch
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 20968
84
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out the java.io.FileWriter constructors.
 
Quiddo Quitch
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
perfect !! thanks for make me learn
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!