Why are readObject and writeObject private, and why would I write transient variables explicitly?

(1) The methods are not declared in any class or interface. A class, that implements the Serializable interface and requires special special handling during the serialization and deserialization process must implement those methods and the serializer/deserializer will try to reflect those methods. This is one of the rather strange corners in Java where the API … Read more