基本运算符:+ - * / % ++ –
public static void main(String[] args) {
int x = 100; // 创建变量并赋值
int y = 67;
int sum; // 创建变量
System.out.println("====加减乘除====");
sum = x + y;
System.out.println(sum); // 167
int jian = y - x;
System.out.println(jian); // -33
int cheng = x * y;
System.out.println(cheng); // 6700
int chu = x / y;
System.out.println(chu); // 1
int qu = x % y;
System.out.println(qu); // 33
System.out.println("====自增====");
// 先赋值、再自增
int s1 = x++;
System.out.println(x); // 101
System.out.println(s1); // 100
// 先自增、再赋值
int s2 = ++x;
System.out.println(x); // 102
System.out.println(s2); // 102
System.out.println("====自减====");
// 先赋值、再自减
int j1 = x--;
System.out.println(x); // 101
System.out.println(j1); // 102
// 先自减、再赋值
int j2 = --x;
System.out.println(x); // 100
System.out.println( j2); // 100
System.out.println("=============");
boolean flags;
flags = (x==y);
System.out.println(flags); // false 假
System.out.println(x!=y); // true 真
System.out.println("=============");
int a = 10, b = 20;
}