字符串
检查字符串是否为空
// 定义一个字符串String str = “This is a string.”;
// 检查判断str是不是为null或者是长度为0的对象
if (str != null && str .length() != 0) {
System.out.println(“This is not null or empty!”);
} else {
System.out.println(“This is one String not null or empty!”);
}