Object obj = null;
if (Objects.isNull(obj)) {
System.out.println("对象为空");
}
String str = null;
if (str == null || str.isEmpty()) {
System.out.println("字符串为空");
}
List<String> list = null;
if (list == null || list.isEmpty()) {
System.out.println("集合为空");
}
String[] array = null;
if (array == null || array.length == 0) {
System.out.println("数组为空");
}
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
推荐阅读:C# Split方法有哪些不常见的用法