0

I was just wondering when serializing any object in java to a file using the ObjectOutputStream, do all the methods to it also get serialized or only the data gets stored to the file?

2
  • 1
    only the fields are serialized Commented Apr 12, 2014 at 3:12
  • 1
    It only saves the objects state, the non-transient fields. Commented Apr 12, 2014 at 3:14

1 Answer 1

1

Serialization is a process of taking object state and transforming it into a format for storage on disk, or sending over the network.

Object state is fully represented by the fields.

Sign up to request clarification or add additional context in comments.

1 Comment

@EJP, I removed that line.

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.