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!