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

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -