Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Serializing the object in jdk 1.5 and deserializing it jdk 1.6

Tags:

java

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..?

like image 804
Crazy4Java Avatar asked Nov 04 '22 18:11

Crazy4Java


1 Answers

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.
like image 200
Mohammod Hossain Avatar answered Nov 08 '22 04:11

Mohammod Hossain