无须多言:
@Test
public void intro() {
assertThat("应该相等", -1 >> 1, equalTo(-1));
assertThat("应该相等", -1 >>> 1, equalTo(Integer.MAX_VALUE));
assertThat("应该相等", -1 << 31, equalTo(Integer.MIN_VALUE));
}
无须多言:
@Test
public void intro() {
assertThat("应该相等", -1 >> 1, equalTo(-1));
assertThat("应该相等", -1 >>> 1, equalTo(Integer.MAX_VALUE));
assertThat("应该相等", -1 << 31, equalTo(Integer.MIN_VALUE));
}