Is this static println
function in out
class from System
namespace?
namespace System { class out { static println ... }
How can I interpret this name? And where in JRE this function is defined? In java.lang.System
/java.lang.Object
?
Is this static println
function in out
class from System
namespace?
namespace System { class out { static println ... }
How can I interpret this name? And where in JRE this function is defined? In java.lang.System
/java.lang.Object
?
No. Actually
out
is a static member in theSystem
class (not as in .NET), being an instance ofPrintStream
. Andprintln
is a normal (overloaded) method of thePrintStream
class.See http://download.oracle.com/javase/6/docs/api/java/lang/System.html#out.
Actually, if
out
/err
/in
were classes, they would be named with capital character (Out
/Err
/In
) due to the naming convention (ignoring grammar).Because out is being called with the
System
class name itself, not an instance of a class (an object), Soout
must be a static variable belonging to the classSystem
.out
must be instance of a class, because it is invoking the methodprintln()
.