Search code examples
javanumberformatexception

NumberFormatException is throw on parsing a integer


I am getting the following exception when i get execute the following code

Integer.parseInt(1357679682162)+1

 INFO | jvm 1 | srvmain | 2013/01/08 22:22:09.496 | Caused by: java.lang.NumberFormatException: For input string: "1357679682162"
 INFO | jvm 1 | srvmain | 2013/01/08 22:22:09.496 | at java.lang.NumberFormatException.forInputString(Unknown Source)
 INFO | jvm 1 | srvmain | 2013/01/08 22:22:09.496 | at java.lang.Integer.parseInt(Unknown Source)
 INFO | jvm 1 | srvmain | 2013/01/08 22:22:09.496 | at java.lang.Integer.parseInt(Unknown Source)

Solution

  • The number you are passing is outside the range of integer which is from -2,147,483,648 to 2,147,483,647