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

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

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

    常用鏈接

    統計

    最新評論

    Bitwise operators and Shift operators

    位運算符與邏輯運算符基本相似,不過后者的對象只是表示真和假的二值運算,位運算符的對象則是二進制數。Java語言中字節、字符和整數等都可以轉換為二進制,所以位運算符的對象也可以是它們。常見位運算符有:
    按位進行與運算 : &
    按位進行或運算 : |
    按位進行位異運算: ^
    按位進行取反運算: ~
    按位進行循環左移:<<,運算符左側對象左移由右側指定的位數,低位補0,最高位拋棄。帶符號的左移位運算相當于對左操作數進行乘2運算。
    按位進行循環右移:>>,運算符左側對象右移由右側指定的位數,若值為正,在最高位插入0,若值為負,在最高位插入1,即移入的最高位和原最高符號位相同。帶符號的右移位運算相當于對左邊的運算對象進行除2運算。
    按位進行無符號右移:>>>,無論運算符左邊的運算對象取值正負,都在高位插入0,即移入位始終補0.
    要注意是沒有按位進行無符號左移的。位運算符的操作數只能是整數,char,byte,short,
    int和long,進行位運算時,總是先將字符型值、字節型值和短整型值轉換為整型再進行位運算。位運算符游標的操作數用于指定移動的位數,按規定其不應超過左側數的進制表示位數。
    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 九寶 閱讀(383) 評論(0)  編輯  收藏 所屬分類: Java Study(JavaThinking4)

    主站蜘蛛池模板: 天堂亚洲国产中文在线| 亚洲精品自在线拍| 久久亚洲精品11p| 性短视频在线观看免费不卡流畅| 亚洲AV日韩AV永久无码下载| a级毛片免费完整视频| 亚洲AV综合色区无码一区爱AV | 人妻丰满熟妇无码区免费| 亚洲精品无码午夜福利中文字幕 | A片在线免费观看| 亚洲日韩精品一区二区三区| 中文字幕免费在线看| 亚洲中文字幕在线乱码| 热99RE久久精品这里都是精品免费| 亚洲一区二区三区影院 | 日韩亚洲人成在线综合日本| 中文字幕在线免费看线人| 久久综合日韩亚洲精品色| 无码精品一区二区三区免费视频 | 91久久成人免费| 亚洲熟女精品中文字幕| 四虎影视永久免费观看| 国产免费久久久久久无码| 亚洲精品无码av人在线观看| 99久9在线|免费| 国产亚洲精aa在线看| 亚洲天堂免费在线视频| 久久久久成人精品免费播放动漫| 亚洲大香人伊一本线| 日本一区免费电影| 国产精品午夜免费观看网站| 亚洲精品视频观看| 四虎影在线永久免费观看| 国产日韩AV免费无码一区二区| 亚洲免费福利视频| 又黄又爽一线毛片免费观看| 18禁在线无遮挡免费观看网站| 中文字幕无码亚洲欧洲日韩| 亚洲一区二区精品视频| 96免费精品视频在线观看| 亚洲AV无码一区二区三区牲色|