Annotary
Sort

Serialization and Deserialization in Java with Example - GeeksforGeeks

www.geeksforgeeks.org
harsha vardhan harsha vardhan
5 months ago
Serialization is a mechanism of converting the state of an object into a byte stream
Cancel
Deserialization is the reverse process where the byte stream is used to recreate the actual Java object in memory
Cancel
The byte stream created is platform independent
Cancel
So, the object serialized on one platform can be deserialized on a different platform.
Cancel
Advantages of Serialization
1. To save/persist state of an object.
2. To travel an object across a network
Cancel
Only non-static data members are saved via Serialization process.
Cancel
Static data members and transient data members are not saved via Serialization process.So, if you don’t want to save value of a non-static data member then make it transient.
Cancel
Constructor of object is never called when an object is deserialized.
Cancel
with each Serializable class called a SerialVersionUID,
Cancel
It is also recommended to use private modifier for UID since it is not useful as inherited member.
Cancel
Show all 10 highlights
Loading...