This is what I see in java, and it puzzles me.
Long.toHexString(0xFFFFFFFF) returns ffffffffffffffff
Similarly, 0xFFFFFFFF and Long.parseLong("FFFFFFFF", 16) are unequal.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As others have said,
0xFFFFFFFFevaluates to the int value-1, which is promoted to along.To get the result you were expecting, qualify the constant with the
Lsuffix to indicate it should be treated as along, i.e.Long.toHexString(0xFFFFFFFFL).