public static boolean isNumeric(String s){
  try {
    Double.parseDouble(s);
    return true;
  }
 catch (  Exception e) {
    return false;
  }
}

public static boolean isNumeric ( String s ) { try { Double . parseDouble ( s ) ; return true ; } catch ( Exception e ) { return false ; } }
checks if a string is a number
