Serialization -- Use of defaultwriteobject()
while we use the readObject() and writeObject() methods during Serialization, what kind of role does the defaultReadObject/defaultwriteobject() methods play there?
In one of the older posts in this forum, i read that defaultReadObject/defaultwriteobject() invoke the "default" serialization/deserialization for that object.
Here are the questions that i have :
1) If defaultwriteobject() invokes the default serialization behavior, how is it different from the case when we do not use the readObject/writeObject methods, and simply extend serializable interface. Is'nt that default serialization?
2) When should defaultReadObject/defaultwriteobject() method be used compulsorily, with the readObject/writeObject methods?
3) When should the readObject/writeObject be used without the defaultReadObject/defaultwriteobject() methods?