教育路上
摘要:使用与、或、异或、非运算符进行运算,并把运算的结果显示在控制台。以下是我们为大家整理的,相信大家阅读完后肯定有了自己的选择吧。
2021-06-06 21:10刘永莘
public class Bits { //静态方法中只能有静态变量 static int a=0xaa; //全局变量 static int b=0x77; public static void main(String[] aaa) { // & System.out.println("a & b="+Integer.toHexString(a&b)); // | System.out.println("a | b="+Integer.toHexString(a|b)); // ^ System.out.println("a ^ b="+Integer.toHexString(a^b)); // ~ System.out.println(" ~a ="+Integer.toHexString(~a)); } }
访客的评论 2024/03/28 20:22
文中描述的是准确的吗,如何报名!