class EBH005 {
public static void main (
String[] s) {
byte b = 127; b <<= 2;System.out.println(b);
}}
What is the result of attempting to compile and run the program?
a. Prints: -4
b. Prints: -3
c. Prints: -2
d. Prints: 0
e. Prints: 1
f. Prints: 127
g. Prints: 508
h. Run-time error
i. Compile-time error
j. None of the above
The answer to above ? is a. Can anybody exaplin me that ? The answer is -4 and I didnot get how 11111100 is converted to -4 ? I know, its two's complement...but still can anybody elaborate it further ?