可能重复: In Java, when should I create a checked exception, and when should it be a runtime exception?
我什么时候才能得到例外 RuntimeException 而不是 Exception ?
RuntimeException
Exception
一 运行期异常 不必在方法的 throws 条款,可能是 好的 因为它不需要特别列出或 坏的 因为显式声明方法的异常是一种良好的实践。
运行期异常
throws
思想?
Unchecked Exceptions -- The Controversy
RuntimeException Exception