Try this:
public class LongTest {
public static void main (String[] args)
{
long long1 = 0xFFFF0000;
long long2 = -0x00010000;
System.out.println(long1 == long2 ?
"long1 is equal to long2" :
"long1 is not equal to long2");
Long long1a = new Long(long1);
Long long2a = new Long(long2);
System.out.println(long1a.equals(long2a) ?
"long1a is equal to long2a" :
"long1a is not equal to long2a");
}
}
The surprising thing is that researching the documentation reveals that this is expected behavior.
Is this a semantic bug, or what am I missing here?
Regards, Darryl