CollectionUtils.isEmpty()
时间: 2024-05-18 22:18:11 浏览: 96
EmptyUtils.java
CollectionUtils.isEmpty()是一个用于判断集合是否为空的方法。当传入的集合参数为null或者集合的大小为0时,该方法返回true;否则返回false。这个方法与List.isEmpty()方法的不同之处在于,当集合为null时,List.isEmpty()会报空指针异常,而CollectionUtils.isEmpty()则不会报错。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [CollectionUtils.isEmpty](https://blog.csdn.net/weixin_40074861/article/details/102680304)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [集合判空CollectionUtils.isEmpty()](https://blog.csdn.net/m0_46845579/article/details/126315293)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文