aspose file tools*
The moose likes Beginning Java and the fly likes system.out.println() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "system.out.println()" Watch "system.out.println()" New topic
Author

system.out.println()

rayal singam
Greenhorn

Joined: Apr 10, 2006
Posts: 3
hi,
what exactly these terms represents.what is the relation b/w system and out here.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42273
    
  64
Moving to "Java in General (beginner)".


Ping & DNS - my free Android networking tools app
John Dell'Oso
Ranch Hand

Joined: Apr 08, 2004
Posts: 130
I think you mean System.out.println() ... (notice the uppercase 'S')

Well, System is a class, out is a static field defined in the System class that is a reference to a PrintStream object (in this case the standard output stream) and println() is a method of the PrintStream class.

All this information is available from the JDK javadocs:

JDK Documentation

Regards,
JD
vignesh hariharan
Ranch Hand

Joined: Jun 23, 2005
Posts: 77
to understand this.. you are supposed to understand some more logic.




with the above example u can use the obj of the Aclass to acces any method of the Bclass by calling Aclass.obj.BclassMethod() just like system.out.println()

and also there is nothing called static object. it is always called only static reference. no static object. so any static content can be called using classname.(dot) staic member name. like that here obj is a static member. so u can use Aclass.obj.disp() jus like System.out.println()

i hope u got it.. the reason it is marked static is that if it is static we can use it inside main.. since main is static or even if we require we can use it outside also.. because System.out.println() is used anywhere. so it has no problem saying static content cant be referenced from non-static etc etc error... so now it is safe from the errors..


Regards,
vignesh
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: system.out.println()