public enum Light {
RED{
@Override
public Light getNextLight() {
return YELLOW;
}
},YELLOW{
@Override
public Light getNextLight() {
return GREEN;
}
},GREEN {
@Override
public Light getNextLight() {
return RED;
}
};
public abstract Light getNextLight();
}
|
|