Question: 6. Suppose that E is a Java enumeration declared as follows: enum E {} where the enumeration constants are not shown. Also assume that a

6. Suppose that E is a Java enumeration declared as follows: enum E {} where the enumeration constants are not shown. Also assume that a is an array of integers whose length is equal to the number of enumeration constants in E. Write a loop that displays each constant in E along with the corresponding element of a. For example, suppose that the enumeration constants are sUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, and SATURDAY, in that order, and that the elements of a are 63, 65, 65, 64, 70, 69, and 68. The loop should produce the following output: SUNDAY 63 MONDAY 65 TUESDAY 65 WEDNESDAY 64 THURSDAY 70 FRIDAY 69 SATURDAY 68
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
