What will be the output of the following Java code snippet?
enum Levels
{
private TOP,
public MEDIUM,
protected BOTTOM;
}
enum Levels
{
private TOP,
public MEDIUM,
protected BOTTOM;
}A. Runtime Error
B. EnumNotDefined Exception
C. It runs successfully
D. Compilation Error
Answer: Option D
Related Questions on Data Types and Variables
Which of the following is not a valid identifier for a Java variable?
A. my_var
B. _myVar
C. 3rdVar
D. $var

Join The Discussion