Java / Design Patterns
How to prevent creating another instance of Singleton during serialization?
You can prevent by using readResolve() method since during serialization readObject() is used to create an instance and it returns new instance every time. However, by using readResolve you can replace it with original Singleton instance.
More Related questions...