Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Data Mining

Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar

1st Edition

321321367, 978-0321321367

Students also viewed these Databases questions