<< >> >>> 位操作运算
作者:互联网
int i = 2;
System.out.println("i 十进制= [" + i + "] ;" + "i 二进制= [" + Integer.toBinaryString(i) + "]");
i = i << 1;
System.out.println("i 十进制= [" + i + "] ;" + "i 二进制= [" + Integer.toBinaryString(i) + "]");
结果:
i 十进制= [2] ;i 二进制= [10]
i 十进制= [4] ;i 二进制= [100]
Process finished with exit code 0
标签:位操作,运算,二进制,System,toBinaryString,println,Integer,十进制 来源: https://www.cnblogs.com/zhidaCoding/p/11289595.html