//File: Hello2.java import java.io.*; import CSLib.*; class Hello2 { public static void main (String [] args) throws IOException { InputBox in = new InputBox(); in.setPrompt ("What's the name of your file? "); String fileName = in.readString(); //FileWriters convert char streams to byte streams FileWriter fw = new FileWriter (fileName); //throws IOException //PrintWriters convert Strings to char streams PrintWriter outFile = new PrintWriter (fw); outFile.println ("Hi there gang!!. Ain't this great?"); outFile.close(); //NOTE: It's important to close output files // after completing output. // Otherwise, you can lose some or all // of your data. } }