Exception handling -checked exception and unchecked exception

Abnormal Root Class is Throwable, Throwable derive the Error and Exception.

Java 8 API Doc in the description of the checked exception and unchecked exception of:

1. checked exception :( described Exception class)

The class Exception and any subclasses that are not also subclasses of RuntimeException are checked exceptions. 

 

2. unchecked exception:

(Description of the Error class)

 Error and its subclasses are regarded as unchecked exceptions for the purposes of compile-time checking of exceptions

(Described RuntimeException class)

RuntimeException and its subclasses are unchecked exceptions. 

 

3. checked exception: Compiler their required display captured or throw, e.g., IOException, SQLException;

unchecked exception: generally occurs at runtime, the compiler is not required to be captured or displayed thrown, e.g. NullPointerException, ClassCastException;

 

RuntimeException and its subclasses are unchecked exceptions

Guess you like

Origin www.cnblogs.com/jayinnn/p/10986633.html
Recommended