如果我们在变量之前使用Complement运算符,那么为什么该变量的值增加1,但是该值的二进制等价项不成立? [英] if we take Complement operator before variable then why the value of that variable increases by 1 but the binary equivalent of that value is not true ?

查看:65
本文介绍了如果我们在变量之前使用Complement运算符,那么为什么该变量的值增加1,但是该值的二进制等价项不成立?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

public class bitwise
{
    public static void main(String args[])
    {
           int x=28;
           System.out.println(~x);
    }
}

推荐答案

您已经使用了补码运算符; NOT运算符是感叹号!
You have used the complement operator; the NOT operator is the exclamation mark !


这篇关于如果我们在变量之前使用Complement运算符,那么为什么该变量的值增加1,但是该值的二进制等价项不成立?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆