Decoding Java Enums and Switch

Report a typo

Given the following code snippet, which statements are correct in terms of Enums in Java?

public enum Day {
    SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY;

    public static void printDay(Day day) {
        switch(day) {
            case SUNDAY: System.out.println("It's Sunday!"); break;
            case MONDAY: System.out.println("It's Monday!"); break;
            // Other cases...
        }
    }
}
Select one or more options from the list
___

Create a free account to access the full topic