Double Greater Than Sign (>>) in Java?

后端 未结 7 1108
南旧
南旧 2020-12-04 13:07

What does the >> sign mean in Java? I had never seen it used before but came across it today. I tried searching for it on Google, but didn\'t find anythin

7条回答
  •  再見小時候
    2020-12-04 14:04

    This is the bit shift operator. Documentation

    The signed left shift operator "<<" shifts a bit pattern to the left, and the signed right shift operator ">>" shifts a bit pattern to the right. The bit pattern is given by the left-hand operand, and the number of positions to shift by the right-hand operand. The unsigned right shift operator ">>>" shifts a zero into the leftmost position, while the leftmost position after ">>" depends on sign extension.

提交回复
热议问题