S
sarathy
Hi all,
Can anyone explain what is the internal meaning of
"System.out.println()"
I guess "System" is a class in java.lang package ==> OK
When i reffered to the source code, i found "out" as
public final static PrintStream out = nullPrintStream();
I guess that this is a static reference variable of type
PrintStream. But how does it print to STDOUT ??? It is just initialized
with nullPrintStream() and since it is marked as final. this might the
only place where it is being assigned. [ i checked there were no static
initializers ]
My guess it that the println() method must be written in some
logic, such that it the stream is explicity mentioned then output in
that stream, else output to STDOUT
Similar is the guess for "in" and "err"
Is this guess right?
Regards,
Sarathy
Can anyone explain what is the internal meaning of
"System.out.println()"
I guess "System" is a class in java.lang package ==> OK
When i reffered to the source code, i found "out" as
public final static PrintStream out = nullPrintStream();
I guess that this is a static reference variable of type
PrintStream. But how does it print to STDOUT ??? It is just initialized
with nullPrintStream() and since it is marked as final. this might the
only place where it is being assigned. [ i checked there were no static
initializers ]
My guess it that the println() method must be written in some
logic, such that it the stream is explicity mentioned then output in
that stream, else output to STDOUT
Similar is the guess for "in" and "err"
Is this guess right?
Regards,
Sarathy