Two deserialized objects (singleton1 and singleton2) have different memory references, but they should be the same.
In the Singleton class, add a method so that after deserialization the object references are the same (Google it).
The main method is not tested.
How do you serialize Singleton?
- 12
Locked
Comments
- Popular
- New
- Old
You must be signed in to leave a comment
This page doesn't have any comments yet