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 Serializable
interface, 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 serialVersionUID
field is just part of the versioning that Java binary serialization uses.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With