Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NumberFormatException error

Status
Not open for further replies.

lostinjava

Programmer
Joined
Feb 5, 2003
Messages
6
Location
US
When I run my program, in the black box I get:

Exception in thread "main" java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Integer.java:394)
at java.lang.Integer.parseInt(Integer.java:476)
at J2.main(J2.java:59)



Line 59 of my program is:
lineone=Integer.parseInt(line);
"lineone" is an int and "line" is a string

any suggestions on what to do? if you have any, i would really appreciate the help, though i am very new with programming and dont know all the technical language

thanks
 
There seems to be a problem in the value of "line" variable.
I suggest writing its value before parsing it into int.
System.out.println("value -->"+line);
There must be something wrong in that value.
Salih Sipahi
Software Engineer.
City of Istanbul Turkey
ssipahi@yonbilgi.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top