原文:Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference

问题原因: ,int和Integer判断是否相等时出错 ,用到int的地方,实际传值是Integer int是基本类型,存数值 integer是对象,用一个引用指向这个对象 解决方案: 对Integer参数进行null判断,如果不为null,再将Integer值转换成int ...

2021-07-10 13:46 0 146 推荐指数:

查看详情

 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM