Java byte λ????? ???????
???????????? ???????[ 2014/2/24 10:40:06 ] ??????????????? ????
????Java??byte ?? + - * / >> >>> << & | ^ (??????????????????????????????????λ??λ??λ???)?????????????????byte????int?? ????????????????????????????
?????????????????????byte???? 1111 1000 ????1λ??????0000 0001 ???????? 0111 1101??
???????д???????£?
????byte b = 0xf8;
????byte b2 = b >> 1 | 0x01;
???????д?????ж?????????????????
????1 ???????????int?????????????byte
????????????????????????
????byte b = (byte)0xf8;
????byte b2 = (byte)( (b >> 1) | 0x01);
????2 ???? 1111 1101 ????????????? 0011 1101
?????????>> ???з??????????????λ?1??????????1????0??
??????????? >>> ??????????
????byte b = (byte)0xf8;
????byte b2 = (byte)( (b >>> 1) | 0x01);
????3 ???к?????????? 1111 1101
?????????byte?????????????int????λ????????????????????£?
????b ????int 1111 1000 ???? 11111111 11111111 11111111 11111000
?????????????1λ 01111111 11111111 11111111 11111100
?????? 0x01 ??λ??
????01111111 11111111 11111111 11111101
????????????byte
????11111101
?????????????????????????? λ?? 0xff
????byte b = (byte)0xf8;
????byte b2 = (byte)( ((b & 0xff )>>> 1) | 0x01); //??????????????? >>> ??????????? &
????4 ???к?????????????????? 0111 1101?????????????£?
????b ????int 1111 1000 ???? 11111111 11111111 11111111 11111000
??????0xff ???? & ???? 00000000 00000000 00000000 11111000
?????????????1λ
????00000000 00000000 00000000 01111100
?????? 0x01 ??λ??
????00000000 00000000 00000000 01111101
????????????byte
????01111101
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11