WHEN TO USE STDERR When printing information to the console, a developer has two choices: System.out and System.err. Information that's intended for the user should be sent out on System.out, and 'error' information should be pushed out onto System.err. While this is relatively obvious, many developers fail to realize why System.err should be used for errors and debugging. When printing out on a stream, the JVM and operating system decide when to flush the stream. This means that although the developer enters: System.out.print("Test Output:"); the JVM/OS combination has no requirement to immediately output the string. Instead, it can wait until it has enough output to push out in one mass. When provided with the following code: System.out.println("Debugging Info."); the JVM may flush this output; however, the OS may decide to keep it cached. This is problematic when using debugging statements to discover the location of an error. For example, consider: for(int i=0; i<56; i++) { System.out.println(i); ... // containing an error } The error may occur when i equals 54, but the printlns may only get as far as 49 before the JVM ends. Numbers 50 through 54 are still sitting in the cache and are lost. Using System.err for error reporting and debugging prevents this from happening, as it is flushed with each output. For example, the following code: for(int i=0; i<56; i++) { System.out.println(i); ... // containing an error } will show the error happening at i equals 54 each time. ----------------------------------------