Question 8
Back to Exercise
Why is enum Config { INSTANCE; } considered the safest singleton?
- A It is faster
- B The JVM guarantees a single instance, even under serialization and reflection, with thread-safe initialisation Correct
- C It can be subclassed
- D It is lazily created on every call
Correct Answer: Option B
Recommended by Effective Java.
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!