The answer of below question is 'g'.Can somebody please explain me how,as i am unable to figure out .
class EBH021 {
public static void main(String[] args) {
System.out.print((-1 & 0x1f) + "," + (8 << -1));
}}
What is the result of attempting to compile and run the program?
a. Prints: 0,0
b. Prints: -1,4
c. Prints: 0x1f,8
d. Prints: 31,16
e. Run-time error
f. Compile-time error
g. None of the above
Thanks
class EBH021 {
public static void main(String[] args) {
System.out.print((-1 & 0x1f) + "," + (8 << -1));
}}
What is the result of attempting to compile and run the program?
a. Prints: 0,0
b. Prints: -1,4
c. Prints: 0x1f,8
d. Prints: 31,16
e. Run-time error
f. Compile-time error
g. None of the above
Thanks