位数计算

        // 1000 0000
        short CHANGE_TAG = 0x80;
        int i = 0;
        // 将标志位置1
        i |= CHANGE_TAG;
        // 初始化或者还原标志位0
//        i &= ~CHANGE_TAG;
        // 判断第8位
//          if((i & CHANGE_TAG) == CHANGE_TAG){
        if((i >> 7 & 0x1) == 1){
            System.out.println(1);
        }else {
            System.out.println(0);
        }

 

posted @ 2019-02-19 18:35  月華  阅读(158)  评论(0编辑  收藏  举报