1

i was referring to this question it mentions that

when a Serializable class implementing readObject/writeObject is subclassed, and if the subclass has its own readObject/writeObject, they don't need to call super's readObject/writeObject. Not so if the super/subclass instead implement Externalizable. In this case, super's writeExternal/readExternal need to be explicitly called. However, this difference is irrelevant from an efficiency point of view.

  1. is this true?
  2. how do i understand this ?
  3. does this mean for every read/write Object method the compiler adds a call to defaultread/writeObject() method in first line?

  4. how does deserialization would behave for custom read methods , how does its gonna resolve parent class objects without superclass constructor example: i only write child class object in stream , and during deseralization what values will i see for parent class objects?

  5. or it just behaves like writeExternal/readExternal methods ?
0

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.