Skip to content

Commit f2ee782

Browse files
CollectionUtils的示例
1 parent b10ef34 commit f2ee782

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package com.collection;
2+
3+
import org.apache.commons.collections.CollectionUtils;
4+
5+
import java.util.ArrayList;
6+
import java.util.List;
7+
8+
/**
9+
* @Auther: Administrator
10+
* @Date: 2019\10\17 0017 23:11
11+
* @Description: 判断集合是否为空。简单方便的工具类
12+
*/
13+
public class CollectionUtilsDemo {
14+
public static void main(String[] args) {
15+
List<String> list=new ArrayList<>();
16+
if(CollectionUtils.isEmpty(list)){
17+
System.out.println("list集合为空");
18+
}
19+
}
20+
21+
}

0 commit comments

Comments
 (0)