Created
September 26, 2021 13:49
-
-
Save wkdalsgh192/20de9012e9404206c90af7c487be693a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Day { | |
int MONDAY = 1; | |
int TUESDAY = 2; | |
int WEDNESDAY = 3; | |
int THURSDAY = 4; | |
int FRIDAY = 5; | |
int SATURDAY = 6; | |
int SUNDAY = 7; | |
} | |
public class EnumExample3 { | |
public static void main(String[] args) { | |
int day = Day.MONDAY; | |
switch (day) { | |
case Day.MONDAY: | |
System.out.println("Mondays are bad"); | |
break; | |
case Day.TUESDAY: | |
System.out.println("Tuesdays are still bad"); | |
break; | |
case Day.WEDNESDAY: | |
System.out.println("Wednesdays are so-so"); | |
break; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment