enum Level { LOW, MEDIUM, HIGH } public class Main { public static void main(String[] args) { Level current = Level.MEDIUM; System.out.println(current); // MEDIUM if (current == Level.MEDIUM) { System.out.println("Halfway there"); } } }
Click Run to execute this code.