Possible Duplicate:
Why does a class implements Serializable interface?
I’m using a tutorial found here: http://www.objectdb.com/tutorial/jpa/eclipse/ee/entity
I’m wondering why this class extends Serializable? I’ve read the description of this class and I don’t understand the importance of serialVersionUID and why it’s necessary for my model.
It doesn’t extend a class – it implements the
Serializableinterface, which is basically just a marker interface to say “I’m fine to be serialized”.The idea is to be able to transparently serialize instances of the class – potentially for caching or other purposes, I’m not sure in this case. The
serialVersionUIDfield is just part of the versioning that Java binary serialization uses.