The operator == is undefined for the argument type(s) int, n

package cn.edu.shu.web.test;{(String[] args) {/*** 非常奇怪的问题,,问题来源是在Struts2的action中,如果从session中取值,如果取不到的话,那么应该为null,由于我将其强转为Integer类型了,其后再将其与Integer比较时,居然抛空指针异常*/Object one = null;Integer two = (Integer) one;System.out.println(null == two);// out put trueSystem.out.println(two instanceof Integer);// out put falseSystem.out.println(two System.out.println(0 == null);}}

都会有回报,愿你天天开心。

The operator == is undefined for the argument type(s) int, n

相关文章:

你感兴趣的文章:

标签云: