Menu
Question Index
...

What will be the output of the following program?

public class BitShift {

    public static void main(String[] args) {
        int num = 0x80000000;
        System.out.print(num + " and  ");
        num = num >>> 31;
        System.out.println(num);
    }
}


-2147483648 and 1
0x80000000 and 0x00000001
2147483648 and -1
1 and -2147483648
Compilation Error or Runtime Error

Doubts

Problems

Topic: Java Bitwise Operators

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App