System.out.println(Long.toHexString(0xcafebabeL));
System.out.println(Long.toHexString(0xcafebabe));
System.out.println(Long.toHexString(0x100000000L + 0xcafebabe));
System.out.println(Long.toHexString(0x100000000L + 0xcafebabeL));
0xcafebabeL 和0xcafebabe 是不同的值
上面的输出为
cafebabe
ffffffffcafebabe
cafebabe
1cafebabe
就是这个原因 |