if(str != null && !str.isEmpty()) { /* do your stuffs here */ }
public class Null { public static boolean isNullOrEmpty(String str) { if(str != null && !str.isEmpty()) return false; return true; } }