Java Reference
In-Depth Information
23.1. The
System
Class
The
System
class provides static methods to manipulate system state and
acts as a repository for system-wide resources.
System
provides function-
ality in four general areas:
•
The standard I/O streams
•
Manipulating system properties
•
Utilities and convenience methods for accessing the current
Runtime
•
Security
You'll learn about security in more detail in
Section 23.5
on page
677
.
23.1.1. Standard I/O Streams
The standard input, output, and error streams are available as static
fields of the
System
class.
public static final InputStream
in
Standard input stream for reading data.
public static final PrintStream
out
Standard output stream for printing messages.
public static final PrintStream
err
Standard error stream for printing error messages. The user
can often redirect standard output to a file. But applications
also need to print error messages that the user will see even
if standard output is redirected. The
err
stream is specifically