Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java Java Objects (Retired) Harnessing the Power of Objects Helper Methods and Conditionals

Florian Janosch
Florian Janosch
871 Points

System.out.println

Can anyone explain the "System.out.println" to me in full depth? I have trouble comprehending the fact that "out" seems to be a "variable"(???) of the class "System"

1 Answer

Victor Learned
Victor Learned
6,976 Points

System: this is a final class in java.lang.

out: this is a static member field of the System class and is of type PrintStream. It's access modifiers are public final and it's instantiated during start up and gets mapped with standard output console of the host. This stream is open by itself immediately after it instantiates and ready to accept data.

Println: this is a method of the PrintStream class. Prints the argument passed to the standard console and a newline.

Here's the javadocs link for System: https://docs.oracle.com/javase/7/docs/api/java/lang/System.html