I am really confused about the purpose of various io classes, for example, If we have BufferedWriter, why we need a PrintWriter?
BufferedReader reader = new Buff
The PrintWriter
is essentially a convenience class. If you want to quickly and easily blast out a line of text to e.g. a log file, PrintWriter makes it very easy.
Three features:
print
and println
methods will take any data type and do the conversion for you. Not just String
.format
method is worth its weight in gold. Now it's as simple in Java as in C to output a line of text with C-style format control.System.out
or System.err
which have few ways of going wrong.