answersLogoWhite

0

Yes using the equals method.

Example:

Double a = new Double(Double.NaN);

Double b = new Double(Double.NaN);

if( a.equals(b) )

System.out.println("True");

else

System.out.println("False");

If you execute the above code snippet you will see "True" in the console. If you try the "==" operator to compare the 2 values a and b you will get only false

User Avatar

Wiki User

15y ago

What else can I help you with?