public class lianxi8 {
public static void main(String[] args) {
ColorEnum colorEnum = ColorEnum.blue;
switch (colorEnum) {
case red:
System.out.println("color is red");
break;
case green:
System.out.println("color is green");
break;
case yellow:
System.out.println("color is yellow");
break;
case blue:
System.out.println("color is blue");
break;
}
}
}
public enum ColorEnum { blue,red,green,yellow } 推断是没有导入ColorEnum 这个类的包
你这突然冒出个ColorEnum
没有导入包?