Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / August 2006

Tip: Looking for answers? Try searching our database.

System.out.println

Thread view: 
sarathy - 05 Aug 2006 07:53 GMT
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
Mike Schilling - 05 Aug 2006 09:42 GMT
> Hi all,
>          Can anyone explain what is the internal meaning of
[quoted text clipped - 10 lines]
> only place where it is being assigned. [ i checked there were no static
> initializers ]

in, out, and err are reset by native code, which doesn't respect final.  See
System.initializeSystemClass().


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.