<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    常用鏈接

    統(tǒng)計

    最新評論

    Bitwise operators and Shift operators

    位運算符與邏輯運算符基本相似,不過后者的對象只是表示真和假的二值運算,位運算符的對象則是二進(jìn)制數(shù)。Java語言中字節(jié)、字符和整數(shù)等都可以轉(zhuǎn)換為二進(jìn)制,所以位運算符的對象也可以是它們。常見位運算符有:
    按位進(jìn)行與運算 : &
    按位進(jìn)行或運算 : |
    按位進(jìn)行位異運算: ^
    按位進(jìn)行取反運算: ~
    按位進(jìn)行循環(huán)左移:<<,運算符左側(cè)對象左移由右側(cè)指定的位數(shù),低位補(bǔ)0,最高位拋棄。帶符號的左移位運算相當(dāng)于對左操作數(shù)進(jìn)行乘2運算。
    按位進(jìn)行循環(huán)右移:>>,運算符左側(cè)對象右移由右側(cè)指定的位數(shù),若值為正,在最高位插入0,若值為負(fù),在最高位插入1,即移入的最高位和原最高符號位相同。帶符號的右移位運算相當(dāng)于對左邊的運算對象進(jìn)行除2運算。
    按位進(jìn)行無符號右移:>>>,無論運算符左邊的運算對象取值正負(fù),都在高位插入0,即移入位始終補(bǔ)0.
    要注意是沒有按位進(jìn)行無符號左移的。位運算符的操作數(shù)只能是整數(shù),char,byte,short,
    int和long,進(jìn)行位運算時,總是先將字符型值、字節(jié)型值和短整型值轉(zhuǎn)換為整型再進(jìn)行位運算。位運算符游標(biāo)的操作數(shù)用于指定移動的位數(shù),按規(guī)定其不應(yīng)超過左側(cè)數(shù)的進(jìn)制表示位數(shù)。
    The bitwise operators allow you to manipulate individual bits in an integral primitive data type.Bitwise operators perform Boolean algebra on the corresponding bits in the two arguments to produce the result. The bitwise operators come from C’s low-level orientation, where you often manipulate hardware
    directly and must set the bits in hardware registers. Java was originally designed to be embedded in TV set-top boxes, so this low-level orientation still made sense. However, you probably won’t use the bitwise operators much.
    The bitwise AND operator (&) produces a one in the output bit if both input bits are one; otherwise, it produces a zero.
    The bitwise OR operator (|) produces a one in the output bit if either input bit is a one and produces a zero only if both input bits are zero.
    The bitwise EXCLUSIVE OR, or XOR (^), produces a one in the output bit if one or the other input bit is a one, but not both.
    The bitwise NOT (~, also called the ones complement operator) is a unary operator; it takes only one argument. (All other bitwise operators are binary operators.) Bitwise NOT produces the opposite of the input bit—a one if the input bit is zero, a zero if the input bit is one.

    posted on 2008-05-20 13:22 九寶 閱讀(376) 評論(0)  編輯  收藏 所屬分類: Java Study(JavaThinking4)

    主站蜘蛛池模板: 黑人精品videos亚洲人| 亚洲人成网站999久久久综合| 午夜无遮挡羞羞漫画免费| 99re6在线精品免费观看| 深夜久久AAAAA级毛片免费看| 国产成人亚洲午夜电影| 91免费在线视频| 国内精品99亚洲免费高清| 亚洲Av熟妇高潮30p| 亚洲色偷偷综合亚洲AV伊人蜜桃| 免费国产va在线观看| 香蕉97超级碰碰碰免费公| 国产人成免费视频| 亚洲AV无码不卡在线播放| 亚洲.国产.欧美一区二区三区| 男人天堂免费视频| 色拍自拍亚洲综合图区| 亚洲国产一区二区三区在线观看| 日韩电影免费在线观看网站| 2020久久精品国产免费| 亚洲色偷偷狠狠综合网| 亚洲精品第一国产综合精品| 美女视频黄频a免费大全视频| 免费能直接在线观看黄的视频| 亚洲AV日韩精品一区二区三区| 亚洲国产模特在线播放| 国产在线观看xxxx免费| 在线免费一区二区| 九九九精品视频免费| 免费黄色毛片视频| 四虎影视久久久免费| 久久精品国产亚洲AV麻豆不卡| 18禁网站免费无遮挡无码中文| 亚洲AV无码专区国产乱码不卡| 亚洲国产V高清在线观看| WWW亚洲色大成网络.COM| 色妞WWW精品免费视频| 666精品国产精品亚洲| 99久久国产精品免费一区二区| 亚洲天堂久久精品| 97视频免费观看2区|