1public class DaysOfTheWeek {
2
3 public enum Days {m, t, w, r, f, sat, s};
4 public static void main(String[] args) {
5 Days d = Days.t;
6 System.out.println(d);
7 //the output would be t
8 }
9}
1public enum AlertLevel {
2 Undefined(0),
3 Ok(1),
4 Warning(2),
5 Alarm(3);
6}
1public enum Level {
2 HIGH{
3 @Override
4 public String asLowerCase() {
5 return HIGH.toString().toLowerCase();
6 }
7 },
8 MEDIUM{
9 @Override
10 public String asLowerCase() {
11 return MEDIUM.toString().toLowerCase();
12 }
13 },
14 LOW{
15 @Override
16 public String asLowerCase() {
17 return LOW.toString().toLowerCase();
18 }
19 };
20
21 public abstract String asLowerCase();
22}
23