Writing to Standard Output


System.out.println("Hello, World!");



System.out is a PrintStream that will write output to the standard output. This is typically the console. System.out is one of the three streams that Java defines to connect with the standard operating system's streams. The other streams are the System.in and the System.err streamsfor reading from standard input and writing to standard error.

The System.out stream is probably the most often used of all the standard operating system streams. System.out has been put to use by nearly every programmer to assist with debugging an application. Because this stream writes to the console, it makes a handy tool to see what's going on at a particular point in your application. In general though, System.out statements should not be left in a code after initial debugging as they can affect performance of the application. A better long-term strategy for gathering debug information in your application is to make use of a logging facility such as what is available in java.util.logging, or the popular Apache Log4J package.




JavaT Phrasebook. Essential Code and Commands
Java Phrasebook
ISBN: 0672329077
EAN: 2147483647
Year: 2004
Pages: 166

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net