File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes how does System.out.println() works Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "how does System.out.println() works" Watch "how does System.out.println() works" New topic

how does System.out.println() works

sapana jain
Ranch Hand

Joined: Oct 24, 2007
Posts: 42
what happens in the background when we write system.out.println().please make it because we know that out is the static member of System class then how can we call a method with i.e println()with the help of a variable because as methods are always called with object.
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42959
out is a static field in System that has been assigned an object of class PrintStream. So you can call any methods of that class.
[ April 15, 2008: Message edited by: Ulf Dittmer ]
I agree. Here's the link:
subject: how does System.out.println() works
It's not a secret anymore!