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

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

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

    敬的世界

    常用鏈接

    統計

    最新評論

    Bitwise and Bit Shift Operators

    Bitwise and Bit Shift Operators
    The Java programming language also provides operators that perform bitwise and bit shift operations on integral types. The operators discussed in this section are less commonly used. Therefore, their coverage is brief; the intent is to simply make you aware that these operators exist.

    The unary bitwise complement operator "~" inverts a bit pattern; it can be applied to any of the integral types, making every "0" a "1" and every "1" a "0". For example, a byte contains 8 bits; applying this operator to a value whose bit pattern is "00000000" would change its pattern to "11111111".

    The signed left shift operator "<<" shifts a bit pattern to the left, and the signed right shift operator ">>" shifts a bit pattern to the right. The bit pattern is given by the left-hand operand, and the number of positions to shift by the right-hand operand. The unsigned right shift operator ">>>" shifts a zero into the leftmost position, while the leftmost position after ">>" depends on sign extension.

    The bitwise & operator performs a bitwise AND operation.

    The bitwise ^ operator performs a bitwise exclusive OR operation.

    The bitwise | operator performs a bitwise inclusive OR operation.

    The following program, BitDemo , uses the bitwise AND operator to print the number "2" to standard output.

    								class BitDemo {
         public static void main(String[] args) {
              int bitmask = 0x000F;
    	  int val = 0x2222;
    	  System.out.println(val & bitmask);  // prints "2"
         }
    
    						

    posted on 2009-05-14 17:43 picture talk 閱讀(383) 評論(0)  編輯  收藏 所屬分類: Java

    主站蜘蛛池模板: 91在线免费视频| 91在线免费观看| 蜜臀91精品国产免费观看| 久久亚洲AV成人无码| 95免费观看体验区视频| 国产产在线精品亚洲AAVV| 成年午夜视频免费观看视频| 国产成人精品日本亚洲直接| 69堂人成无码免费视频果冻传媒| 亚洲妓女综合网99| 成年18网站免费视频网站| 亚洲精品无码国产片| 免费在线观看日韩| h在线看免费视频网站男男| 亚洲另类激情综合偷自拍图| 亚洲另类视频在线观看| 欧美男同gv免费网站观看| 亚洲综合精品第一页| 国产亚洲福利一区二区免费看| 日本一区二区在线免费观看| 亚洲精品无码精品mV在线观看| 无码成A毛片免费| 亚洲一区二区久久| 毛片在线播放免费观看| 亚洲精品和日本精品| 免费在线观影网站| 亚洲手机中文字幕| 国产成人在线观看免费网站| 国产大片免费天天看| 亚洲精彩视频在线观看| 国产精品免费看久久久久| 中文字幕成人免费高清在线视频| 内射干少妇亚洲69XXX| 好爽好紧好大的免费视频国产| 好吊色永久免费视频大全| 亚洲欧洲国产经精品香蕉网| 国产一级高清视频免费看| 日韩电影免费在线观看中文字幕| 激情综合亚洲色婷婷五月| 亚洲熟妇少妇任你躁在线观看无码| 性色av极品无码专区亚洲|