DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Egbert has posted 3 posts at DZone. View Full User Profile

Write Into File

08.04.2010
| 2634 views |
  • submit to reddit
        // Creates a file in c:/test/ and writes into that file

File outFile = new File("C:\\test\\[FILENAME]");
outFile.createNewFile();
		
BufferedWriter out = new BufferedWriter(new FileWriter(outFile));
out.write([WRITING]);
out.flush();
out.close();