How do I write text to a file?

John Zukowski

Writing text involves writing strings, so you would use a FileWriter.

FileWriter fw = new FileWriter(filename);
PrintWriter pw = new PrintWriter(fw);
pw.println("Hello, World");
0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact