question: 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 ; }
target:  Checks if is all number.