标签:style ar java sp amp bs as tt text
remotepath != null 与 !TextUtils.isEmpty(remotepath) 的区别
!TextUtils.isEmpty(remotepath) 与 remotepath != null &&remotepath.length > 0 一样
或者初始化 remotepath = null,这时只判断 remotepath != null 也可以,如果初始化 remotepath = “” ,这时必须 用!TextUtils.isEmpty(remotepath) 判断
可以单独写个java main 方法检验
public class Test {
private static String str = "";
/**
* @param args
*/
public static void main(String[] args) {
setText();
}
public static void setText(){
if(str != null)
System.err.println("daying");
}
}
remotepath != null 与 !TextUtils.isEmpty(remotepath) 的区别
标签:style ar java sp amp bs as tt text
原文地址:http://blog.csdn.net/tw19811220/article/details/39991853