<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

    主站蜘蛛池模板: 亚洲精品福利在线观看| 国产亚洲午夜高清国产拍精品| 亚洲国产精品久久| a毛片免费播放全部完整| 亚洲午夜久久久影院| 久久国产美女免费观看精品 | 亚洲精品永久在线观看| 亚洲中文无码永久免费| 亚洲无线一二三四区| 久久久久久免费视频| 精品国产日韩久久亚洲| 狼友av永久网站免费观看| jizzjizz亚洲日本少妇| 亚洲国产免费综合| 激情综合亚洲色婷婷五月| 台湾一级毛片永久免费| 亚洲综合网站色欲色欲| 亚洲自偷自拍另类图片二区| 岛国片在线免费观看| 99久久国产亚洲综合精品| 成全高清视频免费观看| 精品韩国亚洲av无码不卡区| 综合久久久久久中文字幕亚洲国产国产综合一区首| 噜噜噜亚洲色成人网站| 精品国产日韩亚洲一区| 免费人成毛片动漫在线播放| 亚洲一级毛片在线播放| 国产美女无遮挡免费网站| 很黄很黄的网站免费的| 国产亚洲一区二区三区在线不卡 | 99久久国产精品免费一区二区| 国产AV无码专区亚洲A∨毛片| 91制片厂制作传媒免费版樱花| 亚洲av成人一区二区三区| 亚洲国产成人乱码精品女人久久久不卡 | 国产亚洲漂亮白嫩美女在线| 国产亚洲精品岁国产微拍精品| 国产精品亚洲色婷婷99久久精品| 亚洲午夜久久久久久久久电影网| 7m凹凸精品分类大全免费| 亚洲成AV人影片在线观看|