58,454
社区成员
发帖
与我相关
我的任务
分享
int score = 50;
switch (score / 10) {
case 10:
case 9:
System.out.println("A");
break;
case 8:
System.out.println("B");
break;
case 7:
case 6:
System.out.println("C");
break;
default:
System.out.println("D");
}
1.6也可以。
1.7新增的是支持String的switch