Bidvertiser

Thursday, June 13, 2013

Type mismatch: cannot convert from null to double

Today while I was doing a code review with my team mates, I noticed some code like this
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,
  1. Use Double instead of double, then you may use null.
  2. Use "not a number" (NaN) like this 
submit to reddit

No comments:

Post a Comment