Actually, as indicated by Eng Fouad , 0b10000000 is a whole literal. Integer literals create an int value whose size in Java is 32-bit. The byte data type is an 8-bit two-digit integer.
Thus, assigning an integer literal to a byte type will not work. To create a conversion between two incompatible types, you must use a listing.
b = (byte)0b10000000;
In addition, a signed submission with two additions is -128 110000000 . But MSB 1 can be dropped (represents a negative sign bit), and therefore 10,000,000 is acceptable as 2 additional representations of -128.
Am_i_helpful
source share