84 字
1 分钟
java经验
java 经验
what different between Boolean.TRUE and true
参考链接
[What the difference between Boolean.TRUE and true](https://stackoverflow.com/questions/31775618/what-the-difference-between-boolean-true-and-true)说明
> [](https://stackoverflow.com/posts/31775618/timeline) > > Firstly, I have >private Map<String, Boolean> mem = new HashMap<String, Boolean>();And then:
if (wordDict.contains(s) || Boolean.TRUE==mem.get(s)) { return true; }why can’t I use “mem.get(s)==true” in the if statement. There will be a error “Line 6: java.lang.NullPointerException”
I think I still cannot understant wrapper class well. Please give me some guidance. Thank you!