Java String with not empty "" and not null value

Description

Java String with not empty "" and not null value

public class Main {
  public static void main(String[] argv) throws Exception {
    String str = "";
    System.out.println(isNotEmpty(str));
  }//from  w w w  . j  a va  2 s  . com
  public static boolean isNotEmpty(String str) {
    return !isEmpty(str);
  }
  public static boolean isEmpty(String str) {
    return str == null || str.length() == 0;
  }

}



PreviousNext

Related