title: Java: Difference between PrintStream and PrintWriter
body: <p>What is the difference between <code>PrintStream</code> and <code>PrintWriter</code>? They have many methods in common due to which I often mix these two classes up. Moreover, I think we can use them for exactly the same things. But there has to be a difference, otherwise, there would have been only one class.</p>
  
  <p>I have searched the archives, but couldn't find this question.</p>