Extends the OutputStream abstract class.
Writes output data in commonly readable form (String) instead of bytes.
For files, can be used together with FileOutputStream.
Does not throw exceptions, need manual checking for successfulness.
Data will be written in a default character encoding but UTF8 or Unicode can be specified as well.
The default output (console) is System.in which is a PrintStream.
Auto flushing can be used for the next cases:
a new-line (\n) character is written into the data
the println() method was invoked
an array of bytes is written as data
Constructor parameters of PrintStream:
(FileOutputStream fos, boolean autoFlush[, Charset cs]): linking with the file stream, turning on or off the auto flushing function, optional output character set
(String fileName, boolean autoFlush[, Charset cs]): linking with the file without an explicit file stream, turning on or off the auto flushing function, optional output character set
EXAMPLE FOR USAGE: