Crazy4Java
Crazy4Java

Reputation: 269

Serializing the object in jdk 1.5 and deserializing it jdk 1.6

I was plannnig to do a research , please advise if I try to mix java 1.5 and 1.6. For e.g I have a java 1.5 and I have serialized a java object in a file in c:\ drive and then and then tried opening in java 1.6 will there be any exception and if I do vice versa of it..?

Upvotes: 5

Views: 532

Answers (1)

Mohammod Hossain
Mohammod Hossain

Reputation: 4114

The serialization mechanism itself has not changed. For individual classes it will depend on the specific class. If a class has a serialVersionUID field, this is supposed to indicate serialization compatiblity.

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

Upvotes: 2

Related Questions