Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

in java.lang.NumberFormatException

843810Oct 27 2008
Hello,
my code can compile, but when I try to create an new TempEntry (String info), in java.lang.NumberFormatException keeps appearing by the time I get to my first integer.

/**
* Constructor for objects of class TempEntry
*/
public TempEntry(String info)
{
info = info.trim();
String[] parts= info.split(",");
month= Integer.parseInt(parts[1]);
day= Integer.parseInt(parts[2]);
year= Integer.parseInt(parts[3]);
average= Double.parseDouble(parts[4]);
high= Double.parseDouble(parts[5]);
low= Double.parseDouble(parts[6]);
}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 24 2008
Added on Oct 27 2008
0 comments
44 views