Serializing an object in jdk 1.5 and deserializing its jdk 1.6

I was planning to conduct a study, please let me know if I try to use java 1.5 and 1.6. For example, I have java 1.5, and I serialize a java object in a file in c: \ drive, and then, and then tried to open in java 1.6, there will be some exception, and if I do the opposite, is that?

+5
source share
1 answer

The serialization mechanism itself has not changed. For individual classes, this will depend on the particular class. If the class has a serialVersionUID field, this should indicate serialization compatibility.

private static final long serialVersionUID = -7287480476309918049L;
If it is unchanged, the serialized versions are compatible.
+2
source

All Articles