实例 Java 类中的枚举

x
 
public class Main { 
  enum Level {
    LOW,
    MEDIUM,
    HIGH
  }
  public static void main(String[] args) { 
    Level myVar = Level.MEDIUM; 
    System.out.println(myVar); 
  } 
}
                    

输出结果

MEDIUM