Pergunta

If I implement Externalizable, will I need to specify serialVersionUID in that class for version compatibility?

In other words, does Java check serialVersionUID while deserializing Externalizable objects?

Foi útil?

Solução

Even through a class is Externalizable, one still has to add a serialVersionUID member to the class to indicate even though the interface to the class has changed, it is still compatible as far as the serialized or externalized form of the class.

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4094702

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top