Skip to content

Commit

Permalink
[fix]Java 异常类层次结构图
Browse files Browse the repository at this point in the history
  • Loading branch information
Snailclimb committed Apr 22, 2020
1 parent 4808b9a commit be6a0c8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/java/Java基础知识.md
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,11 @@ final 关键字主要用在三个地方:变量、方法、类。
<p style="font-size:13px;text-align:right">图片来自:https://simplesnippets.tech/exception-handling-in-java-part-1/</p>


![Java异常类层次结构图](./images/exception-architechture-java.png)

<p style="font-size:13px;text-align:right">图片来自:https://chercher.tech/java-programming/exceptions-java</p>


在 Java 中,所有的异常都有一个共同的祖先 java.lang 包中的 **Throwable 类**。Throwable: 有两个重要的子类:**Exception(异常)** 和 **Error(错误)** ,二者都是 Java 异常处理的重要子类,各自都包含大量子类。

**Error(错误):是程序无法处理的错误**,表示运行应用程序中较严重问题。大多数错误与代码编写者执行的操作无关,而表示代码运行时 JVM(Java 虚拟机)出现的问题。例如,Java 虚拟机运行错误(Virtual MachineError),当 JVM 不再有继续执行操作所需的内存资源时,将出现 OutOfMemoryError。这些异常发生时,Java 虚拟机(JVM)一般会选择线程终止。
Expand Down
Binary file added docs/java/images/exception-architechture-java.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit be6a0c8

Please sign in to comment.