Is disabling Checked Exceptions in Java possible?

前端 未结 3 1769
無奈伤痛
無奈伤痛 2021-01-13 00:56

I was reading an article about checked and unchecked Exceptions in Java and found this article/link: https://projectlombok.org/disableCheckedExceptions.html

Accordin

3条回答
  •  失恋的感觉
    2021-01-13 01:43

    Other than hacking the compiler there is no option to disable checked exceptions I know of. Best you can do is catch the checked exception and rethrow it within a runtime exception if you don't want to force the client code to handle the checked exception.

提交回复
热议问题