public static boolean isInteger ( String string ) { if ( string == null ) { return false ; } try { Integer . parseInt ( string ) ; } catch ( NumberFormatException e ) { return false ; } return true ; }
Checks whether the given string has an integer value .