3 ms·
Note that the contract for the equals() method requires that the method always returns true when called on itself. So the designers had to decide whether to bre
by xg15 4y ago
Note that the contract for the equals() method requires that the method always returns true when called on itself. So the designers had to decide whether to break the contract on NaN or the contract on equals(). I could imagine that honoring equals() was the solution with the least expected breakage with downstream users.