Originally posted by Gurumurthy Ramamurthy:
the references are different. Since, NaN is a static field in Double.
Originally posted by Max Rahder:
The use of NaN is not relevant to this discussion
Dan Chisholm<br />SCJP 1.4<br /> <br /><a href="http://www.danchisholm.net/" target="_blank" rel="nofollow">Try my mock exam.</a>
Originally posted by Joe Ess:
No. A static field will have the same value or reference in every instance of a class. The VALUE of NaN is not equal to anything, including itself. That's because it is Not a Number. For example, divide 0 by 0. If you do 0/0 with ints you get an ArithmeticException. With double, you get NaN, meaning the result is invalid.
You've gotta fight it! Don't give in! Read this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|