public static boolean isNumeric(String number){
  if (isNullOrEmpty(number)) {
    return false;
  }
  try {
    Double.parseDouble(number);
    return true;
  }
 catch (  NumberFormatException ex) {
    return false;
  }
}

public static boolean isNumeric ( String number ) { if ( isNullOrEmpty ( number ) ) { return false ; } try { Double . parseDouble ( number ) ; return true ; } catch ( NumberFormatException ex ) { return false ; } }
returns true if the passed string is a valid number .
