* Runtime exceptions:
在定义方法时不需要声明会抛出runtime exception; 在调用这个方法时不需要捕获这个runtime exception;
runtime exception是从java.lang.RuntimeException或java.lang.Error类衍生出来的。
* Checked exceptions:
定义方法时必须声明所有可能会抛出的checked exception; 在调用这个方法时,必须捕获它的checked exception,
不然就得把它的exception传递下去; checked exception是从java.lang.Exception类衍生出来的。





从逻辑的角度来说,checked exceptions和runtime exception是有不同的使用目的的。
checked exception用来指示一种调用方能够直接处理的异常情况。而runtime exception则用来指示一种调用方本身无法处理或恢复的程序错误。

















java.lang.RuntimeException
(程序默认抛出的异常,不需要捕获)
BufferOverflowException,ClassCastException,
DOMException,IndexOutOfBoundsException,
NullPointerException
javax.management.modelmbean.XMLParseException
java.sql.SQLException ...