AndyC1000
asked on
Java check not null on double
Dear all,
I'm getting a null pointer exception in the following code block. I've read I can't check for null if its a double. How do I resolve this?
Thanks
I'm getting a null pointer exception in the following code block. I've read I can't check for null if its a double. How do I resolve this?
int sumHotWater = CalculateSumHotWater(hotwater_map);
double hotwater = 0;
if (sumHotWater != 0) {
hotwater = (applianceTotal.get("Hotwater").doubleValue()); // null pointer exception here
if (hotwater != 0.0) {
hotwater /= sumHotWater;
}
}
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Thanx 4 axxepting
applianceTotal.get("Hotwat
yields you anything. what do you expect it to get you ?