O'Reilly logo

Java Garage by Eben Hewitt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using the System

The System class cannot be instantiated. But you can use its fields to get a hold of the standard out, standard in, and standard error IO streams. These streams represent how to print to the console, how to receive the input the user enters at the console, and the venue for printing error data.

The System class features a number of utility methods that you can use to perform miscellaneous tasks. Let's look at the methods, in order of sexiness.

Printing Data to the User

We have seen this a number of times already. I include it here for pure pedantry (and because there is actually some stuff that we might find useful). To print to the standard output stream, which is the console the user can view when executing a Java application, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required