Oracle
1Z0-804 · Question #16
Which four are true about enums?
The correct answer is A. An enum is typesafe. C. An enum can declare a private constructor. D. All enums implicitly implement Comparable. F. An enum can implement an interface. C: The constructor for an enum type must be package-private or private access.
Java Class Design
Question
Which four are true about enums?
Options
- AAn enum is typesafe.
- BAn enum cannot have public methods or fields.
- CAn enum can declare a private constructor.
- DAll enums implicitly implement Comparable.
- EAn enum can subclass another enum.
- FAn enum can implement an interface.
How the community answered
(28 responses)- A71% (20)
- B11% (3)
- E18% (5)
Explanation
C: The constructor for an enum type must be package-private or private access.
Topics
#enum typesafety#enum constructor#Comparable#enum interface
Community Discussion
No community discussion yet for this question.