0

Pls the error it shows me is enum is not constant...pls help me

public class Program { enum DayOfWeek { SUNDAY; MONDAY; TUESDAY; WEDNESDAY; THURSDAY; FRIDAY; SATURDAY; } public static void main(String[] args) { DayOfWeek d = DayOfWeek.SUNDAY; switch (d){ case SUNDAY: System.out.println("Work"); break; case MONDAY: System.out.println("Lower Work"); break; case TUESDAY: System.out.println("Middle of Week"); break; case WEDNESDAY: System.out.println("Close to weekend"); break; case THURSDAY: System.out.println("Weekend!!!!"); break; case FRIDAY: System.out.println("Sleep time"); break; case SATURDAY: System.out.println("Church time"); } } }

17th Aug 2020, 5:08 PM
Osazuwa Lawson
Osazuwa Lawson - avatar
1 Réponse
0
Thesmallest thanks...So silly of me😅😅
17th Aug 2020, 5:16 PM
Osazuwa Lawson
Osazuwa Lawson - avatar