InterviewSolution
Saved Bookmarks
| 1. |
What is the difference between ‘>>’ and ‘>>>’ operators in java? |
|
Answer» These 2 are the BITWISE right shift OPERATORS. Although both operators LOOK similar. But there is a minimal difference between these two right shift operators.
Example- Num1 = 8, Num2 = -8. So the binary form of these numbers are - Num1 = 00000000 00000000 00000000 00001000 ‘>>’ Operator : 8 >> 1 (Shift by one bit) : Num1 = 00000000 00000000 00000000 00000100 ‘>>>’ Operator : 8 >>> 1 (Shift by one bit) = Num1 = 00000000 00000000 00000000 00000100 |
|