Question: Write an enum type TrafficLight, whose constants (RED, GREEN, YELLOW) take one parameter the duration of the light. Write a program to test the TrafficLight
Write an enum type TrafficLight, whose constants (RED, GREEN, YELLOW) take one parameter the duration of the light. Write a program to test the TrafficLight enum so that it displays the enum constants and their durations.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
