Java - Write code to check if a string is representing a Byte value

Requirements

Write code to check if a string is representing a Byte value

Demo

//package com.book2s;

public class Main {
    public static void main(String[] argv) {
        String src = "book2s.com";
        System.out.println(isByte(src));
    }//from   www . j a  va2  s . c  om

    public static boolean isByte(String src) {
        if (src == null || src.equals(""))
            return false;
        try {
            Byte.parseByte(src);
            return true;
        } catch (Exception e) {
            return false;
        }
    }
}