sign extension
Java
When an integer value from a type with a particular range is stored in a variable with a bigger range, Java uses sign extension to determine the resulting value. The most significant bit in the original value is used to fill the extra bits of the new value. For instance, suppose a byte variable contains the bit pattern, 10000000. If this is stored in a short variable, the resulting bit pattern will be 1111111110000000. If the original value is 01000000, the resulting bit pattern will be 0000000001000000.