daydreamer
daydreamer

Reputation: 91959

Java (de)serialization process

I am curious to know what happens when we de-serialize an object.

For example if my class object is composed of many other objects, how does the object creation process takes place in De-serialization process

Upvotes: 2

Views: 697

Answers (1)

Stephen C
Stephen C

Reputation: 718758

Objects are created with default initialized fields and then populated with attribute values taken from the serial stream. The object creation is done by runtime system "magic" rather than a declared (or implicit) constructor.

Upvotes: 1

Related Questions