|
|
In releases prior to the JDK 1.1, programmers usedSystem.outto display textual output from their programs. In JDK 1.1,System.outshould be used only for debugging purposes. Instead of usingSystem.outto create program output, programmers should create aPrintWriterand use it instead.Here's the
HelloWorldAppprogram re-written to use aPrintWriterto display its output rather thanSystem.out:Note: Example programs throughout this tutorial still useimport java.io.PrintWriter; class HelloWorldApp { public static void main (String[] args) { PrintWriter stdout = new PrintWriter(System.out, true); stdout.println("Hello World!"); } }System.outto display program output in the manner of programs prior to JDK 1.1.
|
|