What will this code print?
Correct answer
2
Explanation
`HIGH` is the third constant in the enum, so its ordinal is 2.
Update: Dhruva Jagannath added a tag on this question
Code
enum Level { LOW, MEDIUM, HIGH }
System.out.println(Level.HIGH.ordinal());
Topics
By Dhruva Jagannath · · 35 views