Compare warm with soft, PrintWriter
is the class and System#out
But the difference between byte and character streams tell you in any decent book/course.UPD
so the difference between PrintWriter and PrintStream
All characters printed by a PrintStream are converted into bytes using the platform''s default character encoding. The PrintWriter class should be used in situations that require writing characters rather than bytes.
Unlike the PrintStream class, if automatic flushing is enabled it will be done only when one of the println, printf, or format methods is invoked, rather than whenever a newline character happens to be output. These methods use the platform''s own notion of line separator rather than the newline character.
- PrintStream uses platform encoding by default (now it does not seem so, in 1.4 and 1.5 added several constructors that accept one of the options encoding).
- The PrintWriter should be used in situations that require writing characters rather than bytes. Despite this type of field System#out are unlikely to change, backward compatibility, after all.
- If enabled autoflush PrintWriter does flush only when caused by one of the print methods.
- It seems PrintWriter uses the line separator of the platform and not always the new line character (\n).