For safe synchronization during serialization, we implemented the readResolve
method, which returns the class object.
Where is this method defined? How does the compiler call it? How does it work?
For safe synchronization during serialization, we implemented the readResolve
method, which returns the class object.
Where is this method defined? How does the compiler call it? How does it work?
It is defined in the Object Serialization Specification #3.7. The compiler doesn't call it: ObjectInputStream
calls it. It's all described there.