Java tutorial
import java.io.BufferedWriter; import java.io.FileWriter; class BufferedWriterDemo { public static void main(String args[]) throws Exception { FileWriter fw = new FileWriter(args[0]); BufferedWriter bw = new BufferedWriter(fw); // Write strings to the file for (int i = 0; i < 12; i++) { bw.write("Line " + i + "\n"); } // Close buffered writer bw.close(); } }