I have cracked my head enough and hence asking here:
This works:
int dummy_1, dummy_2; long final_dummy; dummy_1 = 0x12345678; dummy_2 = 0x78563412; final_dummy = (long)dummy_1 | (long)dummy_2<<32; System.out.println(String.format("%08X", final_dummy)); Answer : 7856341212345678
This doesnt work:
int dummy_1, dummy_2; long final_dummy; dummy_1 = 0xB6F93000; dummy_2 = 0xB6F93000; final_dummy = (long)dummy_1 | (long)dummy_2<<32; System.out.println(String.format("%08X", final_dummy)); Answer: FFFFFFFFB6F93000
Expected answer : B6F93000B6F93000
dummy_1anddummy_2first. They're not the values you think they are. Look at the range ofint. Also, your code would be easier to read if you followed Java naming conventions, and declared your variables at the point of first use.