I: source code, inverse code, complement code

The original and inverse complement of a positive number is the inverse of its own negative number. On the basis of its original code, the sign bits remain the same. The complement of a negative number is added to its inverse. For example, the original code of 1 is 0000 0001, the inverse code is 0000 0001, and the complement code is 0000 0001. For example, the original code of -1 is 1000 0001, and the inverse code is 1111 1110, and the complement code is 11111111

ⅱ : Why is the byte value in the range of -128 to 127?





Int is 4 bytes and stores 32 bits, ranging from -2^31 to 2^31-1. Long stores 64 bits in 8 bytes, ranging from -2^63 to 2^63-1