package test;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
public class test {
public static void main(String[] args) {
//Week w = Week.one;
TrafficLamp t = TrafficLamp.RED;
System.out.println(t.nextLamp());
}
public enum Week{
one(1),two,three;
private Week(){System.out.println("first");}
private Week(int day){System.out.println("second");}
}
public enum TrafficLamp{
RED(30) {
@Override
public TrafficLamp nextLamp() {
// TODO Auto-generated method stub
return GREEN;
}
},GREEN(40) {
@Override
public TrafficLamp nextLamp() {
// TODO Auto-generated method stub
return YELLOW;
}
},YELLOW(12) {
@Override
public TrafficLamp nextLamp() {
// TODO Auto-generated method stub
return RED;
}
};
public abstract TrafficLamp nextLamp();
private int time;
private TrafficLamp(int time){
this.time = time;
}
}
}