In releases prior to the JDK 1.1, programmers usedSystem.out
to display textual output from their programs. In JDK 1.1,System.out
should be used only for debugging purposes. Instead of usingSystem.out
to create program output, programmers should create aPrintWriter
and use it instead.Here's the
HelloWorldApp
program re-written to use aPrintWriter
to 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.out
to display program output in the manner of programs prior to JDK 1.1.