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

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

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

    敬的世界

    常用鏈接

    統(tǒng)計

    最新評論

    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

    主站蜘蛛池模板: 亚洲国产成人va在线观看网址| 午夜免费1000部| 亚洲国产精品丝袜在线观看| 亚洲乱码中文字幕在线| 毛片免费观看的视频在线| 亚洲午夜无码毛片av久久京东热| 最近2019中文字幕mv免费看| 亚洲日韩一区二区三区| 免费看a级黄色片| 国产成人不卡亚洲精品91| 亚洲午夜久久久精品影院| 在线免费视频你懂的| 亚洲国产综合无码一区| 国产成人免费视频| 亚洲最大中文字幕| 国内精品免费视频自在线| 亚洲妇熟XXXX妇色黄 | 美女无遮挡免费视频网站| 亚洲成AⅤ人影院在线观看| 中文字幕乱理片免费完整的| 精品久久免费视频| 精品女同一区二区三区免费播放 | 日本免费人成视频播放 | 三年片在线观看免费西瓜视频| 亚洲成AV人片一区二区密柚| 麻花传媒剧在线mv免费观看| 亚洲啪AV永久无码精品放毛片| 午夜亚洲福利在线老司机| 两个人看的www高清免费视频| 亚洲美女视频网站| 国产一级理论免费版| 97人妻精品全国免费视频| 亚洲精品二三区伊人久久| 亚洲人成影院在线观看| 99久久免费看国产精品| 色偷偷噜噜噜亚洲男人| 亚洲AV无码成人网站久久精品大| 免费看国产成年无码AV片| 2022国内精品免费福利视频| 亚洲福利秒拍一区二区| 免费大黄网站在线看|