How Serialization Detects When a Class Has Changed ?

In order for serialization to gracefully detect when a versioning problem has occurred, it needs to be able to detect when a class has changed. As with all the other aspects of serialization, there is a default way that serialization does this. And there is a way for you to override the default.

The default involves a hashcode. Serialization creates a single hashcode, of type long, from the following information:
  • The class name and modifiers
  • The names of any interfaces the class implements
  • Descriptions of all methods and constructors except private methods and constructors
  • Descriptions of all fields except private, static, and private transient


Enter your email address to get our daily JOBS & INTERVIEW FAQ's Straight to your Inbox.

Make sure to activate your subscription by clicking on the activation link sent to your email