LearnFrenzy
Sign in Take a free test

Records, Enums and Sealed Classes · Records, Enums and Sealed Classes MCQ · Question 6

Inheritance and enums Answer, explanation & discussion

  • MCQ
  • Medium
  • 0 comments
  • Answer explained
  • Moderated community
Question 6 Back to Exercise

Which is true about enums and inheritance?

  • A An enum can extend any class
  • B An enum implicitly extends java.lang.Enum, so it cannot extend another class, but it can implement interfaces Correct
  • C Enums cannot implement interfaces
  • D Enums can be extended by classes
Correct Answer: Option B

Enums are also implicitly final (unless constants have bodies, which become anonymous subclasses).

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links