Rather than trying to work this out by attempting to draw logical inferences, you should read the Java Language Specification:
Point 1. byte
and short
are signed types.
"The values of the integral types are integers in the following ranges:
- For
byte
, from -128 to 127, inclusive
- For
short
, from -32768 to 32767, inclusive" Source JLS 4.2.1
Point 2. The signed integral types are 2's complement.
"The integral types are byte
, short
, int
, and long
, whose values are 8-bit, 16-bit, 32-bit and 64-bit signed two's-complement integers, respectively, and char
, whose values are 16-bit unsigned integers representing UTF-16 code units (§3.1)." Source JLS 4.2
Point 3. You can't assign an int
variable to a byte
variable.
If the type of the right-hand operand is not assignment compatible with the type of the variable (§5.2), then a compile-time error occurs. Source JLS 15.26.1
Point 4. You can assign an int
compile-time constant expression to a byte
variable provided that the value of the expression is in the range of byte
.
"In addition, if the expression is a constant expression (§15.28) of type byte
, short
, char
, or int
:
- A narrowing primitive conversion may be used if the variable is of type
byte
, short
, or char
, and the value of the constant expression is representable in the type of the variable." Source JLS 5.2
Point 5. b3 += 0xFF
is equivalent to b3 = (byte)(b3 + 0xFF)
Source JLS 15.26.2
Point 6. There are no byte
or short
literals.
Source JLS 3.10.1