Java - Write code to check if a string is Number by checking each single letter

Requirements

Write code to check if a string is Number by checking each single letter

Demo

//package com.book2s;

public class Main {
    public static void main(String[] argv) {
        String s = "book2s.com";
        System.out.println(isNumber(s));
    }//from   www  .  jav  a 2 s.c  o  m

    public static boolean isNumber(final String s) {
        if (s == null || s.length() == 0) {
            return false;
        }
        int size = s.length();
        for (int i = 0; i < size; i++) {
            char chr = s.charAt(i);
            if (chr < '0' || '9' < chr) {
                return false;
            }
        }
        return true;
    }
}