1 integer type
Byte accounted for 1 bytes (1 bytes in memory 8 bits
Short takes 2 bytes
int accounted for 4 bytes
Long takes 8 bytes
2 floating-point type
Float takes 4 bytes
Double takes 8 bytes
3 Character type
Char is 2 bytes, character data is 16-bit unsigned integer data, which represents the Unicode set, the range is 0~65535
4. Left shift operator (<<)
The result of the shift is that the left operand is multiplied by the power of 2, and the exponent value is given by the operand on the right.
For example: 128<<1 equals 128*2=256 (left multiply right divide)
5. "Signed" Right shift operator
Symbol extension used: If the sign bit is positive, insert 0 in the high position, and if the sign bit is negative, insert 1 at the high.
For example: 128>>1 equals 128/2=64 (left multiply right divide)
6 "Unsigned" right-shift operator (>>>)
"0 Expansion": both positive and negative, are inserted in the high 0
7 Left Shift assignment operator (<<=)
The left side of the operator shifts the number of digits specified by the value to the left and then assigns the result to the left
8 Right Shift assignment operator (>>=) Ibid.
9 Unsigned Right Shift assignment operator (>>>=) Ibid.
Note: When you perform an unsigned right-shift assignment operation, you may encounter a problem: If you do such a shift operation on a byte or short value, you may not get the correct result, they may be converted to type int and then right-shifted, but the "0 extension" (see 6 above) does not occur. So in this case you get the result of-1.
Basic data types for Java and some operators