Java - Write code to create a function to check if a string is not Empty

Requirements

Write code to create a function to check if a string is not Empty

Demo

//package com.book2s;

public class Main {
    public static void main(String[] argv) {
        String string = "book2s.com";
        System.out.println(notEmpty(string));
    }//  w  ww .  jav a  2 s . co m

    public static boolean notEmpty(final String string) {
        return !isEmpty(string);
    }

    public static boolean isEmpty(final String string) {
        if (string == null) {
            return true;
        }
        return string.trim().length() == 0;
    }
}