View Single Post
  #4 (permalink)  
Old 01-30-2008, 03:23 AM
gibsonrocker800's Avatar
gibsonrocker800 gibsonrocker800 is offline
Senior Member
 
Join Date: Nov 2007
Location: New York
Posts: 143
gibsonrocker800 is on a distinguished road
Send a message via AIM to gibsonrocker800
Well, with this, we will need to use FileWriter. We can overwrite the original file with the new text we want.

Code:
FileWriter out = new FileWriter("hello.txt"); out.write(//new value of x); out.close();
By the way, both FileWriter and Reader constructors throw IOException, so you have to handle it. (try, catch)
__________________
//Haha javac, can't see me now, can ya?
Reply With Quote