1. Exceptions
The user wants the program to take some sensible action in the event of an error. If some operations cannot be completed due to an error, the program should: return to a security state and be able to make some other commands, or allow the results of all operations to be saved and terminate the program in an appropriate manner.
Exception handling tasks: Transfer control from where the error occurred to an error handler that can handle the situation.
Exception Categories: Throwable:error and exception
- Error: Describes an internal error and resource exhaustion error for the Java Runtime system that is hungry. Applications should not run out of this type of object. If such an internal error occurs, in addition to the notification to the user, and try to make the program safe exit.
- Exception:a. RuntimeException: An exception that is caused by a program error. (Runtime)
B. Other exception: There is no problem with the program itself, but exceptions due to problems such as I/O errors belong to other exceptions.
Java Core Reading notes the 11th chapter