my dog learned polymorphism*
The moose likes Beginning Java and the fly likes System.out and System.err differences? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "System.out and System.err differences?" Watch "System.out and System.err differences?" New topic
Author

System.out and System.err differences?

Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
In another thread, kelvin cheung just asked the following.
Originally posted by kelvin cheung:
hi,
may i ask you whats the difference between : system.out and system.err ?

[ May 06, 2004: Message edited by: Dirk Schreckmann ]

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
You may want to take a look at the System class documentation to see what it has to say.
In a nutshell, they're just two different output streams. By default, in Windows, both streams direct text output to the system console.
Note that the "destination" of these output streams can be changed by calling System.setOut(PrintStream) and System.setErr(PrintStream). So, a programmer could decide to direct all normal output to the console, or to a text file, while directing all critical errors to a different location, like a special error log file.
Are you getting the idea?
[ May 06, 2004: Message edited by: Dirk Schreckmann ]
kelvin cheung
Ranch Hand

Joined: Mar 27, 2004
Posts: 120
Hi Dirk Schreckmann ,
i think i understand more now... ^^
thanks man ^^ ~~
 
wood burning stoves
 
subject: System.out and System.err differences?
 
Similar Threads
what is the usage of printStackTrace()?
System.out and System.err
explain the output
Unable to redirect all the eclipse console logs to buffer
how to get Date ?