Created
February 7, 2014 02:11
-
-
Save ejknapp/8856343 to your computer and use it in GitHub Desktop.
Output demo from first project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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