Sagewire Logo

'type' of 'System.out.println'([code][/code])

2 Message(s) by 2 Author(s) originally posted in java misc


From: news Date:   Tuesday, September 06, 2005
If 'System' is a class ,
what exactly is 'System.out' ?

And apparently 'println' is a public method of object 'System.out'.

If 'System.out' is an instance [public object] of Class 'System',
is it necessary the prepend the ClassID, because there are other
'out' objects which are public instances of other than 'System' Class ?
Ie. to distinguish 'System.out' from 'otherClass.out' ?

Thanks for any info.

== Chris Glur.


From: Oliver Wong Date:   Tuesday, September 06, 2005
If 'System' is a class,
what exactly is 'System.out' ?
And apparently 'println' is a public method of object 'System.out'.
If 'System.out' is an instance [public object] of Class 'System',
is it necessary the prepend the ClassID, because there are other
'out' objects which are public instances of other than 'System' Class ?
Ie. to distinguish 'System.out' from 'otherClass.out' ?
Thanks for any info.



System is a class, and "out" is a public static field of that class. To
find out the type of out, why not try
System.out.println(System.out.getClass().getSimpleName()); ?



Next Message: JOB OPENING: JAVA Front-End Web Developer - Atlanta, GA



Programming | Sports | Autos

copyright 2006
Valid XHTML 1.0 Transitional