import java.io.*; // test to write one line to a file public class filetest2 { public static void main(String[] args) throws IOException { System.out.println("File output test started"); FileWriter fwriter = new FileWriter("output.txt"); // next line would open for append, instead of overwrite // FileWriter fwriter = new FileWriter("output.txt",true); PrintWriter outputFile = new PrintWriter(fwriter); outputFile.println("Line one of output file"); outputFile.close(); System.out.println("File output test finished"); } }