java - Integer.parseInt(string) is giving me number format exception -
why code throw numberformatexception
?
int = integer.parseint("1111111111111111111111111111111111111111");
how value of int
string
?
the value you're attempting parse bigger biggest allowable int
value (integer.max_value
, or 2147483647
), numberformatexception
thrown. bigger biggest allowable long
(long.max_value
, or 9223372036854775807l
), you'll need biginteger
store value.
biginteger verybig = new biginteger("1111111111111111111111111111111111111111");
from biginteger
javadocs:
immutable arbitrary-precision integers.
Comments
Post a Comment