Question: JAVA question create an enum Element that stores information about chemical elements. You only need to implement the first five elements, and you only need

JAVA question create an enum Element that stores information about chemical elements. You only need to implement the first five elements, and you only need to record the atomic weight, the group, and the period (listed in the table below).

The enum will have a constructor with signature Element(int weight, int group, int period). The enum will have a private instance field facts that is an array of int

The constructor will initialize the instance field to be an array of size three, and then initialize its elements to be the weight, group, and period of the element, respectively. The enum will have a getter method getFacts() that returns the int[], representing the three values: weight, group, and period for the given elment. Implement this class (if you wish you may implement a main method that demonstrates its use).

JAVA question create an enum Element that stores information about chemical elements.

ElementWeight Group Period 18 1 He Li 4 13 2 ElementWeight Group Period 18 1 He Li 4 13 2

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!