Why Java doesn't support <<< operator

前端 未结 4 745
醉梦人生
醉梦人生 2021-02-05 09:22

Why doesn\'t Java support the <<< (unsigned left shift) operator, but does support the >>> (unsigned right shift) operator?

4条回答
  •  眼角桃花
    2021-02-05 09:59

    Why doesn't Java support the <<< (unsigned left shift) operator, but does support the >>> (unsigned right shift) operator?

    That is because when you left shift the bits , the leftmost bit (AKA SIGNED Bit) is lost anyways.

    Since unsigned left shift operator would do exactly the same thing as the existing left shift operator, we don't have it.

提交回复
热议问题