Question: I need help with this Java program!!! Create an enum Direction: 1: Create an enum in the edu.waketech.ccave.common package called Direction. This enum has the

I need help with this Java program!!!

Create an enum Direction: 1: Create an enum in the edu.waketech.ccave.common package called Direction. This enum has the following values: N, S, E, W, NE, NW, SE, SW, UP, DOWN, UNKNOWN. 2: In the resources directory, create a properties file for each direction except UNKNOWN. For example, resources will contain a file n.properties. This file will contain a series of synonyms for Direction.N, where the property key is meaningless and the property value is a synonym for N, for example, "north". So n.properties would have at least one line n=north A properties file may contain more than one synonym. For example, in the properties file for Direction.UP (up.properties) you wish to define up=u up1=higher Note that even though we don't care about the keys in the properties file, they have to be unique. At a minimum, define long forms for each direction: enum value long form synonym N north S south E east W west NW northwest NE northeast SW southwest SE southeast UP u DOWN d You may add other synonyms as you wish. 3: The Direction enum has an instance variable of type ArrayList that holds the enum's given synonyms from the corresponding properties file information. 4: The Direction enum's constructor reads the associated properties file from the resources directory and adds the synonyms to the ArrayList instance variable.

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!