Demo2 does not compile as you are using a wrapper class Byte of smaller primitive size to hold the integer result generated by compound assignment.
In case of Demo2 following things happen
1) b is unboxed from Byte wrapper to byte and then incremented by 10
2) The result is to be narrowed down to byte
3) The result is to be boxed back to Byte wrapper.
JAVA does not support boxing of a result that is narrowed down. You can use a bigger wrapper like Long or Integer and can still use compound operator .
In case of Demo1, JAVA does not have to box back a result at all as it is assigned to a byte primitive type.