This discussion is archived
1 Reply Latest reply: Jan 18, 2013 10:15 AM by gimbal2 RSS

Exception in thread main

974235 Newbie
Currently Being Moderated
Please can someone help me out with this code errors?
Thanks.
Exception in thread "main" java.lang.NumberFormatException: For input string: ""

at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at BufRead.main(BufRead.java:28)
  • 1. Re: Exception in thread main
    gimbal2 Guru
    Currently Being Moderated
    You'd have to post the code.

    But what is so hard to understand here? Apparently you have some code which tries to parse a String into an integer (I'm guessing when read from the command prompt / shell), but in this case it is given an empty string and an empty string cannot be transformed into a number. Hence the exception. Its not a code error, it just a regular problem that can happen in an application that you need to deal with somehow.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points