//File: Hello.java import java.io.*; import CSLib.*; class Hello { public static void main (String [] args) { InputBox in = new InputBox(); in.setPrompt ("What's the name of your file? "); String fileName = in.readString(); try { //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. } catch (IOException e) { } } }