Hai Sharda Vajjhala, Double.isNaN is taking an argument to check whether the argument passed is NaN or not, returns accordingly. We will have to analyse only one statement, that is... return (v != v == Double.isNaN(v)). We start analysing from d3 to d1. d3 has the max double value. The expression goes always from left to right. So (v != v), obviously returns false, now (false == Double.isNaN(v)), v is max value of double, so isNaN returns false. Now the expression is like (false == false), returns true thats why. As far as d2 is concerned, the above said will suit for this also. d1 has NaN value. (v != v) RETURNS true !! Because two NaN values are always not equal. Now (true == Double.isNaN(v)), v has NaN value, so (true == true), return true.