I\'m parsing a doc and I get the following error:
Exception in thread \"main\" java.lang.NumberFormatException: For input string: \"null\"
at sun.misc.Fl
Based on your error, it is very possible your latValues[i].trim()
displays the value "null
". I'm able to replicate your problem here:-
Float.valueOf("null");
Here's the stacktrace:-
java.lang.NumberFormatException: For input string: "null"
at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1301)
at java.lang.Float.valueOf(Float.java:375)
In another word, the value you have is not null, but it contains the word "null".
If you do Float.valueOf(null);
, that actually gives you a NullPointerException
, which is not what you have here.