On Thu, 22 Oct 2009 17:19:52 -0700 (PDT), Booter
<> wrote, quoted or indirectly quoted someone who
said :
> grade = delimiter.nextInt();
>
>was not preforming as expected. Does this method get negative
>numbers?
Javadoc says:
Scans the next token of the input as an int. This method will throw
InputMismatchException if the next token cannot be translated into a
valid int value as described below. If the translation is successful,
the scanner advances past the input that matched.
If the next token matches the Integer regular expression defined above
then the token is converted into an int value as if by removing all
locale specific prefixes, group separators, and locale specific
suffixes, then mapping non-ASCII digits into ASCII digits via
Character.digit, prepending a negative sign (-) if the locale specific
negative prefixes and suffixes were present, and passing the resulting
string to Integer.parseInt with the specified radix.
That means it wants simple ints, no spaces, no commas, but a single
lead - is ok.
--
Roedy Green Canadian Mind Products
http://mindprod.com
Nothing is so good as it seems beforehand.
~ George Eliot (born: 1819-11-22 died: 1880-12-22 at age: 61) (Mary Ann Evans)