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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!