Reputation: 2527
With Java Serialization, I understand that when a field is marked as transient, it is not serialized. So when the object is deserialized, what happens to the fields that were set to transient? Do they get set to the values defined in the constructor?
Upvotes: 6
Views: 801
Reputation: 310860
They get set to the default value for the type: zero, false, or null.
Upvotes: 11