Why can serialize objects to define serialversionUID value?

  • SerialVersionUid to serialize objects version control, tell compatible when deserializing JVM versions
  • If this value is changed in the new version, the new version is not compatible with older versions, it will throw an exception InvalidClassException deserialization
  • Increased by only one attribute, we hope backward compatible with older versions of data are retained, do not modify
  • To delete an attribute, or change the class hierarchy, can not fail to be compatible with old data, then you should manually update SerialVersionUid


 


 

All resources resources are summarized in the public No.


 

 

Guess you like

Origin www.cnblogs.com/ConstXiong/p/11871224.html