Solved

Enum Color {RED, GREEN, BLUE}

Question 72

Essay

enum Color {RED, GREEN, BLUE}
public class EnumOrdinal
{
    public static void main(String[] args)
   {
     ---Code here---
     ---Code here---
     ---Code here---
    }
}
The above code demonstrates the use of the enum ordinal() method to get the ordinal value of an enum constant. Fill in the indicated 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  : " + Col...

View Answer

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

Related Questions