Java - Write code to check if a string is Not Empty using and operator

Requirements

Write code to check if a string is Not Empty using and operator

Demo

//package com.book2s;

public class Main {
    public static void main(String[] argv) {
        String str = "book2s.com";
        System.out.println(isNotEmpty(str));
    }//from   w w w.java 2  s .  c o m

    public static boolean isNotEmpty(String str) {
        return ((str != null) && (str.length() > 0));
    }
}