PrintStream and PrintWriter APIs are almost identical, and can output all forms of data in almost the same way
PrintWriter to accept writer parameters.
API comparisons:
So, what is the difference between them? From Stackflow
The main meaning is that 2 classes function basically the same, PrintStream can do printwriter also can be achieved, and PrintWriter function more powerful. But because PrintWriter appears late, earlier System.out use PrintStream to achieve, so in order to be compatible there is no discarded printstream.
The biggest difference between the 2 classes is that printstream in the output character, converting characters to bytes using the system's default encoding format, which can cause problems when data is transferred to another platform and another platform decodes with another encoding format, which is an uncontrollable factor. The PrintWriter can be encoded when the programmer specifies the characters to be converted to bytes when the writer is passed in, so that compatibility and controllability are better.