Give More Examples Of Compatible Changes In Java Serialization?
Answer»
Adding a NEW field will not affect serialization. The newly added field will be set to its default VALUES when the object of an older version of the CLASS is unmarshaled.
Changes In access modifiers such as private, public, protected or default is compatible since they are not reflected in the serialized object stream.
Changing a TRANSIENT field to a non-transient field, static to non-static are compatible changes.
Adding or removing writeObject()/readObject() METHODS.