摘要: 今天工作中出现空指针异常,调试了半天不知其解,结果碰运气搞定了。出空指针异常的代码比如是:public class April{ public April(String name, int number) { ...... } public static void main(String[] args) { Integer number = null; new April("...", number); }}构造函数参数的类型是int,main函数里用的是包装类型,构造的时候会将Integer unbox成int... 阅读全文
posted @ 2013-04-09 19:24 robbietree 阅读(4566) 评论(0) 推荐(1) 编辑