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));
    }//from  www.  ja  va 2s . 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;
    }
}