小编Kee*_*tan的帖子

java中的"| ="和"^ ="是什么意思?

这是用于改变图像的比特值的功能.是什么|=^=意味着什么呢?

private int setBitValue(int n,int location,int bit)  {
    int toggle=(int)Math.pow(2,location),bv=getBitValue(n,location);
    if(bv==bit)
       return n;
    if(bv==0 && bit==1)
       n|=toggle;        // what does it do?
    else if(bv==1 && bit==0)
       n^=toggle;        // what does it do?

    return n;
}
Run Code Online (Sandbox Code Playgroud)

java

5
推荐指数
1
解决办法
113
查看次数

标签 统计

java ×1