Skip to content

Instantly share code, notes, and snippets.

@ejknapp
Created February 7, 2014 02:11
Show Gist options
  • Save ejknapp/8856343 to your computer and use it in GitHub Desktop.
Save ejknapp/8856343 to your computer and use it in GitHub Desktop.
Output demo from first project
package java112.labs1;
import java.io.*;
/**
* @author Eric Knapp
* class OutputDemo
* TODO: comment
*/
public class OutputDemo {
public void run() {
PrintWriter out = null;
try {
out = new PrintWriter(new BufferedWriter(new FileWriter("foo.out", true)));
out.println("Hi, mom.");
} catch (IOException ioexception) {
ioexception.printStackTrace();
} catch (Exception exception) {
exception.printStackTrace();
} finally {
if (out != null) {
out.close();
}
}
}
public static void main(String[] args) {
OutputDemo demo = new OutputDemo();
demo.run();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment