Java - Write code to check if a string is all Digit via char array

Requirements

Write code to check if a string is all Digit via char array

Demo

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

  public static boolean isDigit(String str) {
    if (isNotNull(str)) {
      for (char c : str.toCharArray()) {
        if ((c < '0' || c > '9'))
          return false;
      }
    } else {
      return false;
    }
    return true;
  }

  public static boolean isNotNull(String str) {
    if (null != str && !"".equals(str)) {
      return true;
    } else {
      return false;
    }
  }
}