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

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

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

    常用鏈接

    統(tǒng)計(jì)

    最新評論

    Bitwise operators and Shift operators

    位運(yùn)算符與邏輯運(yùn)算符基本相似,不過后者的對象只是表示真和假的二值運(yùn)算,位運(yùn)算符的對象則是二進(jìn)制數(shù)。Java語言中字節(jié)、字符和整數(shù)等都可以轉(zhuǎn)換為二進(jìn)制,所以位運(yùn)算符的對象也可以是它們。常見位運(yùn)算符有:
    按位進(jìn)行與運(yùn)算 : &
    按位進(jìn)行或運(yùn)算 : |
    按位進(jìn)行位異運(yùn)算: ^
    按位進(jìn)行取反運(yùn)算: ~
    按位進(jìn)行循環(huán)左移:<<,運(yùn)算符左側(cè)對象左移由右側(cè)指定的位數(shù),低位補(bǔ)0,最高位拋棄。帶符號的左移位運(yùn)算相當(dāng)于對左操作數(shù)進(jìn)行乘2運(yùn)算。
    按位進(jìn)行循環(huán)右移:>>,運(yùn)算符左側(cè)對象右移由右側(cè)指定的位數(shù),若值為正,在最高位插入0,若值為負(fù),在最高位插入1,即移入的最高位和原最高符號位相同。帶符號的右移位運(yùn)算相當(dāng)于對左邊的運(yùn)算對象進(jìn)行除2運(yùn)算。
    按位進(jìn)行無符號右移:>>>,無論運(yùn)算符左邊的運(yùn)算對象取值正負(fù),都在高位插入0,即移入位始終補(bǔ)0.
    要注意是沒有按位進(jìn)行無符號左移的。位運(yùn)算符的操作數(shù)只能是整數(shù),char,byte,short,
    int和long,進(jìn)行位運(yùn)算時(shí),總是先將字符型值、字節(jié)型值和短整型值轉(zhuǎn)換為整型再進(jìn)行位運(yùn)算。位運(yùn)算符游標(biāo)的操作數(shù)用于指定移動(dòng)的位數(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)

    主站蜘蛛池模板: 国产又黄又爽又猛的免费视频播放| 国产成人在线观看免费网站 | 一级A毛片免费观看久久精品| 久久国产精品免费一区二区三区| 国产在线精品免费aaa片| 最近最好的中文字幕2019免费| 亚洲 综合 国产 欧洲 丝袜| 久久久久亚洲AV无码永不| 免费人成网站永久| 青青青免费国产在线视频小草| 浮力影院亚洲国产第一页| 亚洲日韩中文字幕无码一区| 国产免费无码一区二区| 久久精品国产亚洲AV麻豆不卡| 午夜亚洲国产理论片二级港台二级| 麻花传媒剧在线mv免费观看| 中文字幕亚洲激情| 丁香花在线视频观看免费| 四虎永久在线精品免费影视| 亚洲免费福利视频| 中文字幕免费视频一| 中文字幕亚洲日韩无线码| 国产好大好硬好爽免费不卡| 在线亚洲精品自拍| 视频免费1区二区三区| 亚洲午夜久久久久久噜噜噜| 九一在线完整视频免费观看| 国产在线19禁免费观看国产| 一级毛片免费播放视频| 亚洲av无码不卡一区二区三区| 国产男女爽爽爽爽爽免费视频| 亚洲电影中文字幕| 国产免费爽爽视频在线观看| 亚洲欧洲日产国码在线观看| 99精品视频在线观看免费专区| 久久精品国产亚洲麻豆| 香蕉免费一级视频在线观看| 亚洲日本国产乱码va在线观看| 国产免费小视频在线观看| a毛片全部播放免费视频完整18| 中文字幕在亚洲第一在线|