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

    class Z
    {

    }

    enum Enums extends Z
    {
    DCB, FEG, HIJ, LMN;
    }

    1. Compilation Error
    2. Runtime Error
    3. It runs successfully
    4. EnumNotDefined Exception
    5. None of these
Correct Option: A

Enum types cannot extend class.



Your comments will be displayed only after manual approval.