Created
January 24, 2011 21:17
-
-
Save ejknapp/793977 to your computer and use it in GitHub Desktop.
This file contains hidden or 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.util.*; | |
| import java.io.*; | |
| /** | |
| *@author Eric Knapp class OutputDemo | |
| *@created January 24, 2011 | |
| */ | |
| public class OutputDemo { | |
| /** | |
| * Main processing method for the OutputDemo object | |
| */ | |
| public void run() { | |
| PrintWriter out = null; | |
| try { | |
| out = new PrintWriter( | |
| new BufferedWriter(new FileWriter("outputDemo.out"))); | |
| out.println(); | |
| out.print("Hi, "); | |
| out.println("there"); | |
| } catch (java.io.IOException ioException) { | |
| ioException.printStackTrace(); | |
| } catch (Exception exception) { | |
| exception.printStackTrace(); | |
| } finally { | |
| out.close(); | |
| } | |
| } | |
| /** | |
| * The main program for the OutputDemo class | |
| * | |
| *@param args The command line arguments | |
| */ | |
| 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