编辑代码

public class asss {
    public static void main(String[] args) {
        int a = 10;
        int b = 5;
        int add = a + b; // 加法
        int jian = a - b; // 减法
        int cheng = a * b; // 乘法
        int chu = a / b; // 整除
        boolean da = a > b; // 大于
        boolean xiao = a < b; // 小于
        boolean deng = a == b; // 等于
        boolean bedeng = a != b; // 不等于
        // 逻辑运算符
        boolean and = (a > 0) && (b > 6); // 与
        boolean or = (a > 0) || (b < 0); // 或
        boolean not = !(a == b); // 非
        // 位运算符
        int weiyu = a & b ;
        int weihuo = a & b ;
        int weifei =  ~ b ;
        int yihuo = a ^ b;
        System.out.println("加法: " + add);
        System.out.println("减法: " + jian);
        System.out.println("乘法: " + cheng);
        System.out.println("整除: " + chu);
        System.out.println("大于: " + da);
        System.out.println("小于: " + xiao);
        System.out.println("等于: " + deng);
        System.out.println("不等于: " + bedeng);
        System.out.println("与: " + and);
        System.out.println("或: " + or);
        System.out.println("非: " + not);
         System.out.println("位与: " + weiyu);
         System.out.println("位或: " + weihuo);
         System.out.println("位非: " + weifei);
         System.out.println("异或: " + weihuo);
        
        
        
    }
}