代码之家  ›  专栏  ›  技术社区  ›  Tony the Pony

是否正确使用RuntimeException?[复制品]

  •  16
  • Tony the Pony  · 技术社区  · 15 年前

    可能重复:
    In Java, when should I create a checked exception, and when should it be a runtime exception?

    我什么时候才能得到例外 RuntimeException 而不是 Exception ?

    运行期异常 不必在方法的 throws 条款,可能是 好的 因为它不需要特别列出或 坏的 因为显式声明方法的异常是一种良好的实践。

    思想?

    2 回复  |  直到 7 年前
        2
  •  11
  •   surendrapanday 9swampy    7 年前

    推荐文章