public static boolean isAllNumber(String str){
  boolean hasNumber=false;
  for (int i=0; i < str.length(); i++) {
    if (!(Character.isDigit(str.charAt(i)) || str.charAt(i) == '.' || str.charAt(i) == ',' || str.charAt(i) == '%' || str.charAt(i) == '$' || str.charAt(i) == '_')) {
      return false;
    }
 else     if (Character.isDigit(str.charAt(i)))     hasNumber=true;
  }
  if (hasNumber == true)   return true;
 else   return false;
}

public static boolean isAllNumber ( String str ) { boolean hasNumber = false ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { if ( ! ( Character . isDigit ( str . charAt ( i ) ) || str . charAt ( i ) == '.' || str . charAt ( i ) == ',' || str . charAt ( i ) == '%' || str . charAt ( i ) == '$' || str . charAt ( i ) == '_' ) ) { return false ; } else if ( Character . isDigit ( str . charAt ( i ) ) ) hasNumber = true ; } if ( hasNumber == true ) return true ; else return false ; }
checks if is all number .
