I\'m a beginner to Java programming and I encounter the following exception:
Exception in thread \"main\" java.lang.NumberFormatException: null
at ja
This exception occurs if you try to convert a string to a number, where the string does not actually contain a number.
Example:
Integer.valueOf("10").intValue();
works, but Integer.valueOf("abcd").intValue()
throws out the NumberFormatException
.
Check your input file and make sure you're actually having a number there.
Line by Line debugger would be very useful here. Also use the good old System.out.println
to see the value in id
.