Java exceptions are a mechanism provided by Java for handling errors.
The so-called error refers to some of the abnormal events that occur during the process of running the program (for example: except 0 overflow, array subscript out of bounds, the file to be read does not exist, etc.)
A well-designed program should provide a way to handle these errors when an exception occurs, so that the program does not block or produce unpredictable results because of an exception.
The Java program can generate an object of the exception class, which encapsulates some information about the exception event and submits it to the Java operating system, which is called throwing an exception, as an exception event occurs during execution.
When the Java system receives an exception object, it looks for the ability to handle this exception code and hand the current exception object to its processing, a process called catch (catch) exception.
Error is called a fault and is generated and thrown by a Java virtual machine, including dynamic link failure, virtual machine error, and the program does not handle it (nor can it handle it).
Exception: The parent class of all exceptions, whose subclasses correspond to a variety of possible exception events, typically require the user to display claims or captures.
RuntimeException: A special kind of anomaly, such as divisible by 0, array subscript out of bounds, and so on, it is more frequent, processing trouble, if the display declaration or capture will have a significant impact on the readability and operational efficiency of the program, Therefore, the system automatically detects it and gives it to the default exception handler (which the user does not have to handle).