This is what I see in java, and it puzzles me.
Long.toHexString(0xFFFFFFFF) returns ffffffffffffffff
Long.toHexString(0xFFFFFFFF)
ffffffffffffffff
Similarly, 0xFFFFFFFF
0xFFFFFFFF
As others have said, 0xFFFFFFFF evaluates to the int value -1, which is promoted to a long.
-1
long
To get the result you were expecting, qualify the constant with the L suffix to indicate it should be treated as a long, i.e. Long.toHexString(0xFFFFFFFFL).
L
Long.toHexString(0xFFFFFFFFL)