File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

I want clear explanation,Plz explain

 
Anil Pattnaik
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 java.io package.So,even if we donot insert java.io package how println("....") method is executed.
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"out" is a field in the System class of type PrintStream. That PrintStream is in the java.io 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
Greenhorn
Posts: 29
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic