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("數組為空");
}