有两种方法可以在java中确定list是否为空,两种方法是等效的
其中之一
if(list==null||list.size(=0) ) (/为空时) else(//不为空时)之二
if (如果list==null|) list.isempty (() ) /为空) else(//不为空)
其中list.size(==0等于list.isEmpty ) )。 一般使用第二种方式
If (列表!=空! list.isEmpty (() /不为空;else )//为空)。
有两种方法可以在java中确定list是否为空,两种方法是等效的
其中之一
if(list==null||list.size(=0) ) (/为空时) else(//不为空时)之二
if (如果list==null|) list.isempty (() ) /为空) else(//不为空)
其中list.size(==0等于list.isEmpty ) )。 一般使用第二种方式
If (列表!=空! list.isEmpty (() /不为空;else )//为空)。
版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。