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?

有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top