Google+ Followers

Nov 23, 2010

Why i need the serialVersionUID?

Hi,
So many times i have been asked "what's for", "why i need it". It is very that you add this static variable to you class. The reason is simple, run time calculation cost for computing this UID can result in unexpected class exception, performance etc.
The object is needed for serialization process and deserialization.
I recommend you also to read http://java.sun.com/j2se/1.5.0/docs/api/java/io/Serializable.html.
Regards,
Dor

No comments:

Post a Comment