简单明了理解Java移位运算符

无须多言:

    @Test
    public void intro() {
        assertThat("应该相等", -1 >> 1,  equalTo(-1));
        assertThat("应该相等", -1 >>> 1, equalTo(Integer.MAX_VALUE));
        assertThat("应该相等", -1 << 31, equalTo(Integer.MIN_VALUE));
    }
posted @ 2017-02-24 22:04  邓晓锋  阅读(131)  评论(0编辑  收藏  举报