| Author |
java.lang.NumberFormatException
|
nikil shar
Ranch Hand
Joined: May 25, 2008
Posts: 116
|
|
hi all,
i get this error when trying to parse a string :
java.lang.NumberFormatException: For input string: "12345501297"
i dont see why it throws this error ??
thanks in advance.
|
 |
Vijitha Kumara
Bartender
Joined: Mar 24, 2008
Posts: 3670
|
|
|
The value you are trying to parse is too large for "int" type. Check with "Integer.MAX_VALUE".
|
SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
|
 |
chandrakant karale
Ranch Hand
Joined: Nov 21, 2007
Posts: 41
|
|
If you are dealing with large account numbers, use long as datatype; replace Integer.parseInt by Long.parseLong.
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
|
And if they still don't fit you have little option but to use BigInteger.
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
 |
|
|
subject: java.lang.NumberFormatException
|
|
|