File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes I want clear explanation,Plz explain Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "I want clear explanation,Plz explain" Watch "I want clear explanation,Plz explain" New topic

I want clear explanation,Plz explain

Anil Pattnaik

Joined: Jun 15, 2006
Posts: 8
Please anybody can explain the pupose of "System.out.println("....");"
We know System class comes under java.lang package.But println method belongs to PrintStream class which comes under package.So,even if we donot insert package how println("....") method is executed.
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
"out" is a field in the System class of type PrintStream. That PrintStream is in the package does not matter, as it is never used directly. If "PrintStream" appeared anywhere in the source, it would need to be imported; because it does not, it needn't be.
Vinay Belagavi

Joined: Jun 15, 2006
Posts: 29
In the System.out.println "out" is a static object of the PrinStream class which is created in the lang package(default package).It is used to call the println() in the PrintStream class which does the printing job.

A programmer need not import io package for doing simple output operations.
I agree. Here's the link:
subject: I want clear explanation,Plz explain
It's not a secret anymore!