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).

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
Get step-by-step solutions from verified subject matter experts
