package com.lyc.struct;
public class SwitchDemo01 {
public static void main(String[] args) {
//case 穿透(如果不写break ,case将会把代码执行到底,所以匹配到选项后需要用break来终止)
char grade = 'C';
switch (grade){
case 'A':
System.out.println("优秀");
break;
case 'B':
System.out.println("良好");
break;
case 'C':
System.out.println("及格");
break;
case 'D':
System.out.println("需要努力");
break;
case 'E':
System.out.println("挂科");
break;
default:
System.out.println("未知等级");
}
}
}