Can an enum extend another enum in Java?

  1. Yes, if the base enum is abstract
  2. Yes, using inheritance
  3. No, enums cannot extend any class except Enum
  4. Yes, with final keyword
Correct answer No, enums cannot extend any class except Enum

Explanation

Java enums cannot extend another enum or any class other than the `java.lang.Enum` they implicitly extend.

Update: Admin added a tag on this question

Topics

By Admin · · 27 views