← Quiz: Java Enums: all 10 questions
Quiz: Java Enums · Question 5 of 10
Which statement about an enum constructor is true?
Which statement about an enum constructor is true?
- A.It must be public
- B.It is always private; you can never call new on an enum
- C.It runs every time a constant is used
- D.An enum cannot have a constructor
Answer & explanation
Correct answer: It is always private; you can never call new on an enum
Enum constructors are private and run once per constant when the enum is loaded.
Can you get the rest right without peeking?
Take the timed Quiz: Java Enums quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →