String str ="ss";
str ="";
if(str!=null && !str.isEmpty()){
System.out.println("234");
}
List<String> list = new ArrayList<String>();
list = null;
if (list != null && !list.isEmpty()) {
System.out.println("234");
}
更新 判断字符串是否为空 引用了jpa的StringUtils
String str ="ss";
str =null;
if(StringUtils.isEmpty(str)){
System.out.println("234");
}
网友评论