- 运算符与关系表达式
DEMO
// 运算符的加减
int num1 = 5, num2 = 0;
++num1;// 先加再赋值
// num1++;赋值再加
// num2--;
--num2;
System.out.println("++num1 " + num1);
System.out.println("++num2 " + num2);
// 运算符的比较
int num1 = 5, num2 = 3, num3 = 4;
boolean flag;
if (num1 < num2) {
flag = true;
System.out.println(flag + " num1=" + num1 + " < " + "num2=" + num2);
} else if (num2 < num3) {
flag = true;
System.out.println(flag + " num2=" + num2 + " < " + "num3=" + num3);
} else if (num1 < num3) {
flag = true;
System.out.println(flag + " num1=" + num1 + " < " + "num3=" + num3);
} else {
flag = false;
System.out.println(flag + " n