Hello,
since I am pretty new to Java, I apollogize for this stuipd question,
but I am really lost at the moment.
Here is a somehow modified example of what I want to do:
public enum TrafficLight {
Green(0); Yellow (1); Red (2)
}
public enum TrafficSigns {
Stop (0);
:
}
// class to configure the settings of the current road ending in a
crossing
// assuming that there is only one traffic light controlling the go /
nogo status of this road;
public class RoadInCrossing {
public int noLanes;
public TrafficLights thisTrafficLight;
public TrafficSigns thisTrafficSign;
public Boolean thisTrafficLightStatus;
public configureRoadInCrossing (int noLanes, TrafficLight color,
TrafficSigns sign) {
this.noLanes = noLanes;
this.thisTrafficLight = color;
this.thisTrafficSign = sign;
this.thisTrafficLightStatus = FALSE; //indicating that
trafficlight is off
}
}
// now the environment complains (therortically correctly) that
TrafficLights and TrafficSigns cannot be resolved - but how do I
get the system to get their meaning.
Well theoretically I might just put these values in the class and
hopefully solve the proble,m .. however as far as I can see at the
moment thes enumerations are basic enumerations that are going to be
used within the complete project, therefore I would like them to be
public....
Has anyone any idea on how I might get them known???
Ta


|