Possible Duplicate:
How do I save a String to a text file using Java?
I want to add a reading from a machine to a file (Java). The reading will be in the form of a string that I have formatted. The file is just a text file. At the moment I am considering Filewriter/Buffered writer is this the correct one to use?
Use FileWriter will do you job.
BufferedWriter writer = new BufferedWriter( new FileWriter( yourfilename));
writer.write( yourstring);
// do stuff
writer.close();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With