is String Empty Or Null - Java java.lang

Java examples for java.lang:String Null Or Empty

Description

is String Empty Or Null

Demo Code


public class Main{

    public static void main(String[] argv){
        String str = "java2s.com";
        System.out.println(isEmptyOrNull(str));
    }/* ww  w.j  av a2s  .co  m*/
    public static boolean isEmptyOrNull(String str) {
        return str == null || str.isEmpty();
    }

}

Related Tutorials