posted 5 years ago
 1
you should find it in the Java Language Specification. That might not be easy to read, so let’s try without. Those numbers are ints, which occupy 32 bits (4 bytes) each.
0x47 should be 0x00000047, which in binary is 0000_0000_0000_0000_0000_0000_0100_0111
0xa3 should be 0x000000a3, which in binary is 0000_0000_0000_0000_0000_0000_1010_0011
The exclusive or operator checks whether the two digits in the same location are the same (1^1 or 0^0), or different (1^0 or 0^1). It returns 1 for different and 0 for same. Putting those numbers together, we get
0000_0000_0000_0000_0000_0000_0100_0111
0000_0000_0000_0000_0000_0000_1010_0011
0000_0000_0000_0000_0000_0000_1110_0100
Voilà! 228 when it is converted to decimal.
0x47 should be 0x00000047, which in binary is 0000_0000_0000_0000_0000_0000_0100_0111
0xa3 should be 0x000000a3, which in binary is 0000_0000_0000_0000_0000_0000_1010_0011
The exclusive or operator checks whether the two digits in the same location are the same (1^1 or 0^0), or different (1^0 or 0^1). It returns 1 for different and 0 for same. Putting those numbers together, we get
0000_0000_0000_0000_0000_0000_0100_0111
0000_0000_0000_0000_0000_0000_1010_0011
0000_0000_0000_0000_0000_0000_1110_0100
Voilà! 228 when it is converted to decimal.
Do not set lab on fire. Or this tiny ad:
The WEB SERVICES and JAXRS Course
https://coderanch.com/t/690789/WEBSERVICESJAXRS
