is q:throable being checked for abnormalities?
A: Yes
In the Java specification, the definition of a non-checked exception and a checked exception is this:
- The unchecked exception classes is the
run-time
exception classes and the error
classes.
- The checked exception classes is all exception classes other than the unchecked exceptionclasses. That is, the checked exception classes be throwable and all it subclasses other than RuntimeException and its subclasses and Error and its subclasses.
That is, run-time exception
all exceptions except and its subclasses, and error
its subclasses, are checked for exceptions.
The exceptions in Java are categorized as follows:
Error
Usually some underlying hardware-related errors, unrelated to the program itself, should not be captured because of the inability to capture.
RuntimeException
Is the exception thrown by the program itself, such errors must be the programmer's own logic errors or irregularities caused, can be captured or not captured, if not actively captured will be processed by the JVM.
- The rest
受查异常
is not expected in the programming process, such as file read and write exceptions, database access exceptions, and so on, this is not the program itself error, in order to ensure the robustness of the program, these exceptions must be captured.
is the Throwable class in Java being checked for exceptions?