// 公共方法
public static boolean isNull(Object o) {
boolean isNull = false;
if (null == o || o.toString().isEmpty() || "null".equalsIgnoreCase(o.toString())) {
isNull = true;
}
return isNull;
}
// 方法调用
if (!isNull(aa)) {
System.out.println("内容不为空!");
}else{
System.out.println("内容为空!");
}
标签:判断,Java,System,空值,isNull,boolean,toString,null,out
From: https://blog.51cto.com/u_15406246/11982234