I just wanted to know if the out
variable in System.out.println()
is initialized in the static block of the System
class. The out
field is declared as a final static variable, which equals null (public final static PrintStream out = null;
) . Since out is pointing to null, I assume it is being pointed to the PrintStream
object somewhere. But I can't see the code except a native method called registerNatives()
. Is it being pointed to in a native method? Why is it being done that way (any performance advantage)?
Also, the documentation for the out
variable in System
says:
The "standard" output stream. This stream is already open and ready to accept output data. Typically this stream corresponds to display output or another output destination specified by the host environment or user."
Thanks.