Java - Write code to Checks if a String is whitespace, empty ("") or null. Using two return statements

Requirements

Write code to Checks if a String is whitespace, empty ("") or null. Using two return statements

Demo

//package com.book2s;

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


    public static boolean isBlank(String str) {
        int strLen;
        if (str == null || (strLen = str.length()) == 0) {
            return true;
        }
        for (int i = 0; i < strLen; i++) {
            if ((Character.isWhitespace(str.charAt(i)) == false)) {
                return false;
            }
        }
        return true;
    }
}