Difficulty: Easy
Correct Answer: -2147483648 and 1
Explanation:
Introduction / Context:
This problem demonstrates Java's unsigned right shift operator (>>>) and how it differs from arithmetic right shift (>>), especially with negative numbers.
Given Data / Assumptions:
Concept / Approach:
Unsigned right shift inserts zeros on the left. Shifting MIN_VALUE (1000...0) by 31 positions yields 0000...0001.
Step-by-Step Solution:
Verification / Alternative check:
Try arithmetic right shift (>>) to see that it would yield -1 by sign extension, highlighting the difference.
Why Other Options Are Wrong:
They either show hex formatting (not what System.out prints here) or results of signed shift, not unsigned.
Common Pitfalls:
Confusing >>> with >> and expecting sign extension instead of zero fill.
Final Answer:
-2147483648 and 1
Discussion & Comments