Java - Write code to check if a string is Alpha Space

Requirements

Write code to check if a string is Alpha Space

Demo

//package com.book2s;

public class Main {
    public static void main(String[] argv) {
        String str = "book2s.com";
        System.out.println(isAlphaSpace(str));
    }/* w ww. j a  v  a  2 s.  c om*/

    public static boolean isAlphaSpace(String str) {
        if (str == null) {
            return false;
        }

        int length = str.length();

        for (int i = 0; i < length; i++) {
            if (!Character.isLetter(str.charAt(i))
                    && (str.charAt(i) != ' ')) {
                return false;
            }
        }

        return true;
    }
}