Solved

Enum Color {RED, GREEN, BLUE}

Question 80

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

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents