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

About System.out.println() method

Venu Babu Ravi

Joined: Jun 08, 2010
Posts: 16

1)Can any one expline about System.out.println() method ?
2)How we can call System.out ?
3)How we can call out.println()?

Thanks in Advance ....

Abimaran Kugathasan
Ranch Hand

Joined: Nov 04, 2009
Posts: 2066

System is a Class in Java API. out is a static field in that System class, So you called with 'System.out' as usual.

Have look at this API

println() is a method of the class PrintStream, since the System class has the the static instance(out) of this class(PrintStream), we invoked println() method on top of that instance

Have look at here

|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
Prasad Kharkar
Ranch Hand

Joined: Mar 07, 2010
Posts: 446

System is a class in java
out is the static field of System class that gives us the PrintStream for output
println() method prints whatever text is provided in it and goes to the next line
it is fully defined as

as it is static field we call it using the class name i.e. System.out

Now printlln() is the method defined in the PrintStream class and we are calling the println() method using PrintStream object got using System.out

hence in short
means that print a line of text and go the next line on the output stream of the System.

about your third question
you have to read a little about static imports
you can find it herehere

SCJP 6 [86%], OCPWCD [84%], OCEJPAD [83%]
If you find any post useful, click the "plus one" sign on the right
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Venu Babu Ravi wrote:1)Can any one expline about System.out.println() method ?

from source file of PrintStream in Java API., so it just give you the new line/emptyline.

Venu Babu Ravi wrote:2)How we can call System.out ?

Generally, System.out called as variable which point to the PrintStream object

Venu Babu Ravi wrote:3)How we can call out.println()?

using the PrintStream object's reference you are calling the method of println.

Hebert Coelho
Ranch Hand

Joined: Jul 14, 2010
Posts: 754

You can call out.println() by making a Static Import.

its like:

C Ya

[] [Full WebApplication JSF EJB JPA JAAS with source code to download] One Table Per SubClass [Web/JSF]
I agree. Here's the link:
subject: About System.out.println() method
It's not a secret anymore!