如图,java 在判断的时候,既然不等于null,为什么还要判断size大于0?不等于null肯定大于0呀?
黄舟
黄舟 2017-04-18 10:13:53
0
11
1493

if (passengerList!=null&&passengerList.size()>0) {

} else {

}

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(11)
刘奇

When list==null, the system reports a null pointer exception when list.size()>0 is executed.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template