Writing to a File

If the file does not already exist, it is automatically created.
try { BufferedWriter out = new BufferedWriter(new FileWriter("outfilename")); out.write("aString"); out.close(); } catch (IOException e) { }

Comments

3 Feb 2010 - 11:43pm by Anonymous (not verified)

good

26 Feb 2010 - 7:57pm by Anonymous (not verified)

GREAT!!! THANKS!! :)

Post a comment

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image. Ignore spaces and be careful about upper and lower case.