switch
switch (i) {
case 1://case后只能接常量/常量表达式..不能表范围
System.out.println("1 is ok!");
break;//表示退出switch语句
case 3-1://3-1=2
System.out.println("2 is ok!");
break;
case 3:
System.out.println("3 is ok!");
break;
default://表示所有条件都不满足就执行default语句
System.out.println("nothing happed");
break;
}
max = i>j? i: j;//一般用来赋值