Home » JAVA Programming » Basic Datatypes » Question
  1. What is the output of below code snippet?

    enum Levels
    {
    private BOTTOM,

    public MEDIUM,

    protected TOP;
    }
    1. Runtime Error
    2. EnumNotDefined Exception
    3. Compilation Error
    4. It runs successfully
    5. None of these
Correct Option: C

Enum cannot have any modifiers. They are public, static and final by default.



Your comments will be displayed only after manual approval.