/* FileOutput2.java CIS 160 David Klick 2010-09-15 Demonstrates writing data to a file. */ import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; public class FileOutput2 { public static void main(String[] args) throws IOException { double num = 12.67; PrintWriter out = new PrintWriter(new FileWriter("fout.txt")); // write data to file out.print("David"); out.print(" G."); out.println(" Klick"); out.println(num); out.println("That's all folks!"); out.println("How's it going?"); out.println(3.1415926); out.println("Bye now?"); out.close(); } }