System.out in Java

Out field in java.lang.System Class

Subscribe to my newsletter and never miss my upcoming articles

System.out is the first instance of the OutputStream class most programmers encounter. In fact, it's often encountered before programmers know what a class or an output stream is. Specifically, System.out is the static out field of the java.lang.System class. It's an instance of java.io.PrintStream, a subclass of java.io.OutputStream. System.out corresponds to stdout in Unix or C. Normally, output sent to System.out appears on the console. As a general rule, the console converts the numeric byte data System.out sends to it into ASCII or ISO Latin-1 text. Thus, the following lines write the string "Hello World!" on the console:

byte[] hello = {72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33, 10, 
 13}; 
System.out.write(hello);

See more

System.err

Comments (1)

Silent Walker's photo

Good one Thank you