0

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?

AstroCB
  • 12,337
  • 20
  • 57
  • 73
Ankush soni
  • 1,439
  • 1
  • 15
  • 30
  • 2
    I can recommend you a reading: Effective Java by Joshua Bloch - chapter 11. Serialization – sodik Apr 18 '15 at 17:29

1 Answers1

0

It is defined in the Object Serialization Specification #3.7. The compiler doesn't call it: ObjectInputStream calls it. It's all described there.

user207421
  • 305,947
  • 44
  • 307
  • 483