The exception class level for Java is clearly shown on this map.
Throwable: as an ancestor of all exceptions, there are two subclasses that derive exception and error two, respectively.
Error: The presence of error indicates that the JVM is having a problem as a running environment, causing the program to throw an error and crash.
Exception: The exception that the program runs itself. RuntimeException and IOException are derived from two major classes.
runtimeexception: runtime exceptions, including logically such as array out-of-bounds, null pointers, type conversion errors, classes not found, and so on. Logic-related exceptions should be logically avoided, the compiler does not check, and does not require certain processing.
non-runtime exception: not processed, compilation does not pass. such as IOException and SqlException, and user-defined exceptions.
Exceptions are handled in such a way that:
capture:try...catch ...
Throw: give a layer of processing. Throws an exception when defining a method using throws. In the code, the throwis used instead of the active throw exception. Don't be silly in the future, wrong but to hit their own butt.
Multiple exceptions occur at the same time, and the exception is an inheritance relationship, how do I run it?
The answer is:
Exception as an ancestor of all exceptions, if placed in front of other exceptions, will compile the exception, not through the grammar check.
Otherwise, the exception is placed at the end, so the most exact matching exception will be executed.
Java Exception System