java异常分类三大类 检查性异常有哪些?

检查性异常有哪些?java中异常分为两类:checked exception(检查异常)和unchecked exception(未检查异常),对于未检查异常也叫RuntimeException(运行

检查性异常有哪些?

java中异常分为两类:


checked exception(检查异常)和unchecked exception(未检查异常),对于未检查异常也叫RuntimeException(运行时异常)。


对未检查的异常(unchecked exception )的几种处理方式:


1、捕获;


2、继续抛出;


3、不处理。


对检查的异常(checked exception,除了RuntimeException,其他的异常都是checked exception )的几种处理方式:


1、继续抛出,消极的方法,一直可以抛到java虚拟机来处理;


2、用try...catch捕获。