This post originated from an RSS feed registered with Java Buzz
by Ananth Chelladurai.
Original Post: Type mismatch: cannot convert from null to double
Feed Title: Ananth Chellathurai's walk on software
Feed URL: http://feeds2.feedburner.com/AnanthChellathuraisWalkOnSoftware
Feed Description: My blood is tested +ve for java
Today while I was doing a code review with my team mates, I noticed some code like this
<![CDATA[double actGrossC1Budget = (Double) null;]]>
When I asked them why do you type cast "null to double", the answer they gave was I got "Type mismatch: cannot convert from null to double". There are 2 possible solutions for this,
Use Double instead of double, then you may use null.
Use "not a number