Should class IOException in Java have been an unchecked RuntimeException?

前端 未结 6 1012
夕颜
夕颜 2021-02-05 05:29

Do you agree that the designers of Java class java.io.IOException should have made it an unchecked run-time exception derived from java.lang.RuntimeException<

6条回答
  •  [愿得一人]
    2021-02-05 06:25

    No because you can recover from some IOExceptions. Most notable ones are low level indexed reads and writes. If it fails, sometimes you can just retry without harm.

提交回复
热议问题