What is the purpose of extending a Java serializable class?

Possible duplicate:
Why does the class implement the Serializable interface?

I am using the tutorial found here: http://www.objectdb.com/tutorial/jpa/eclipse/ee/entity

I am wondering why this class extends Serializable ? I read the description of this class and I do not understand the importance of serialVersionUID and why it is necessary for my model.

+6
source share
1 answer

It does not extend the class - it implements the Serializable interface, which is basically a marker interface to say "I", m fine for serialization. "

The idea is to be able to transparently serialize class instances - perhaps for caching or other purposes, I'm not sure about this. The serialVersionUID field is part of the version that Java binary serialization uses.

+9
source

Source: https://habr.com/ru/post/903508/


All Articles