Enums are considered best way for singletons and one of reasons for this is that it implicitly inherits Serializable
.
But how enums prevents de-serialization problem of singletons?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…