wood burning stoves
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
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "system.out.println()" Watch "system.out.println()" New topic


rayal singam

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

Joined: Mar 22, 2005
Posts: 42965
Moving to "Java in General (beginner)".
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

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..

I agree. Here's the link: http://aspose.com/file-tools
subject: system.out.println()
It's not a secret anymore!