Checked : 你可以在写代码的时候就throw 或者try catch 的

Unchecked :  Error   + RuntimeException 。提前无法预测的

http://www.cnblogs.com/shihuc/p/5201905.html

NUllpointerException一个例子:不一定要去捕获空指针异常

(2)访问或修改 null 对象的字段。
class Point {
public int x, y;
public int getX() {
return x;
}
}

public class TestNullPointerException {
static Point p1;

public static void main(String args[]){

p1.x = 1; // 此处抛出NullPointerException

}
}

posted on 2017-10-09 17:07  立中宵  阅读(280)  评论(0编辑  收藏  举报