Java语言支持如下运算符
- 
算数运算符:+ , - , * , / ,%(余数) , ++ ,--
 - 
赋值预算符 =
 - 
关系运算符:> , < , >= , <= ,==(等于) ,!= instanceof(不等于的表示方法)
 - 
逻辑运算符:&& , || , !
以下了解即可
 - 
位运算符:&,|,^, ~,>> , << , >>>
 - 
条件运算符 ?:
 - 
扩展赋值运算符: += , -=, *= , /=
 
任意非long整数作运算,结果总是int型
   long a = 1234564896L;
        int b = 123;
        short c = 10;
        byte d = 2;
        double abe=2.5;
        System.out.println(a+b+c+d);//结果变为long型
        System.out.println(b+c+d);//结果为int型
        System.out.println(c+d);//结果也为int型
        System.out.println(abe+d);//结果为double型
        //任意非long整数作运算,结果总是int型
        //当数值中有double型运算后就为double型
 //关系运算符:返回ture false  运用布尔值 运算 后期在if中大量运用
        int h = 10;
        int f = 23;
        System.out.println(a==b);
        System.out.println(a!=b);
        System.out.println(a>=b);
        System.out.println(a<=b);
        System.out.println(a<b);
        System.out.println(a>b);
         //%取两个数相处之后的余数
        System.out.println(f%h);
                    
                
                
            
        
浙公网安备 33010602011771号