package com.myapp.test;
public class EnumTest {
public enum Weekdays {
Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday
};
public EnumTest() {
Weekdays weekDays;
}
public EnumTest(Weekdays testday) {
switch (testday) {
case Saturday:
case Sunday:
System.out.println("It'sthe weekend!");
break;
case Wednesday:
System.out.println("It'sHumpday!");
break;
case Friday:
System.out.println("TGIF!");
break;
default:
System.out.println("Backto work!");
}
}
public static void main(String[] args) {
EnumTest myUE = new EnumTest();
EnumTest myUE2 = new EnumTest(Weekdays.Sunday);
}
}
public class EnumTest {
public enum Weekdays {
Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday
};
public EnumTest() {
Weekdays weekDays;
}
public EnumTest(Weekdays testday) {
switch (testday) {
case Saturday:
case Sunday:
System.out.println("It'sthe weekend!");
break;
case Wednesday:
System.out.println("It'sHumpday!");
break;
case Friday:
System.out.println("TGIF!");
break;
default:
System.out.println("Backto work!");
}
}
public static void main(String[] args) {
EnumTest myUE = new EnumTest();
EnumTest myUE2 = new EnumTest(Weekdays.Sunday);
}
}