p { margin-bottom: 0.21cm; }
public enum Trafficlamp {
RED (30) {
public Trafficlamp nextLamp() {
return GREEN ;
}
},
GREEN (30) {
public Trafficlamp nextLamp() {
return YELLOW ;
}
},
YELLOW (20) {
public Trafficlamp nextLamp() {
return RED ;
}
};
public abstract Trafficlamp nextLamp();
int time ;
private Trafficlamp( int time){ this . time = time;}
}