Possible Duplicate:
Serialization version uid in Java
We know that Java serialization mechanism ignore static fields. If it is this, then how the deserializer knows the serialVersionUID of the serializer. serialVersionUID is always a static field of the class to be serialized. Thank you for your help.
cheng
The
serializedVersionUIDis written to the stream, even though it is static.It is then used on deserialization to compare it against the one in the currently available version of the class.
Note that it is not written as part of every instance, but as part of the “ObjectStreamClass” that defines the class for all instances in the stream that want to use it.