Solved

Enum Color {RED, GREEN, BLUE}

Question 31

Essay

enum Color {RED, GREEN, BLUE}
public class EnumOrdinal
{
public static void main(String[] args)
{
____
____
____
}
}
The above code demonstrates the use of the enum ordinal() method to get the ordinal value of an enum constant. Fill in the shaded lines with println() statements that will get the ordinal of the enumeration constant. Describe the output that will display when the code is executed.

Correct Answer:

verifed

Verified

System.out.println("Color.RED : " + Colo...

View Answer

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions