theStupidOne
theStupidOne

Reputation: 57

NullpointerException when converting String to double in java

I have an html form which contains a String which I need to convert into a double. Then store it in an MS Access database. I tried using:

Double d = Double.parseDouble(String);

But it is throwing a NullpointerException. Can anyone explain why?

Upvotes: 0

Views: 1732

Answers (1)

Jeffrey
Jeffrey

Reputation: 44808

Taking a look at the API reveals that Double.parseDouble throws a NullPointerException if the argument is null.

Upvotes: 3

Related Questions