PrintWriter vs FileWriter in Java

后端 未结 7 1125
谎友^
谎友^ 2020-11-29 19:36

Are PrintWriter and FileWriter in Java the same and no matter which one to use? So far I have used both because their results are the same. Is there some special cases where

7条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-29 19:53

    A PrintWriter has a different concept of error handling. You need to call checkError() instead of using try/catch blocks.

提交回复
热议问题