开发者社区> 问答> 正文

Java中Error(错误)和 Exception(异常)是哪个类的子类呢?

Java中Error(错误)和 Exception(异常)是哪个类的子类呢?

展开
收起
游客k7rjnht6hbtk6 2021-11-02 20:56:58 798 0
1 条回答
写回答
取消 提交回答
  • Error(错误)和 Exception(异常)都是 java.lang.Throwable 类的子类,在 Java 代码中只有继承了 Throwable 类的实例才能被 throw 或者 catch。

    2021-11-02 20:58:11
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Spring Cloud Alibaba - 重新定义 Java Cloud-Native 立即下载
The Reactive Cloud Native Arch 立即下载
JAVA开发手册1.5.0 立即下载