int i=12;
switch(i) {
case 3:
case 4:
case 5:
System.out.print("春季");
break;
case 6:
case 7:
case 8:
System.out.print("夏季");
break;
case 9:
case 10:
case 11:
System.out.print("秋季");
break;
case 12:
case 1:
case 2:
System.out.print("冬季");
break;
default:
System.out.print("没有对应的季节");
break;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
十六进制(重点&难点)
int a=1,b=5,c=3;
int tempMax=a>b?a:b;//变量中第一个单词首字母小写,第二个单词首字母大写;类的首字母大写;变量,方法的首字母小写
int max=tempMax>c?tempMax:c;
System.out.println("max="+max);
1
2
3
4
数字三角形(重点&难点)