Question: Enum Write an enum type called TrafficSignal, which contains the constants RED, GREEN, YELLOW, WALK, DONT_WALK with each constant having a parameter for the duration
Enum
Write an enum type called TrafficSignal, which contains the constants RED, GREEN, YELLOW, WALK, DONT_WALK with each constant having a parameter for the duration of the constant (have the duration be in terms of seconds). Write a program that tests the TrafficSignal enum so that it displays each enum constant and the duration of the enum constant.
Java
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
