Serialization
✅ Serialization
converting the state of an object into a
byte
stream
- all PCs would have different virtual memory according to their OS
- so
reference types
cannot travel across a network, need to be serialized - transmit object data in forms of address❌ byte⭕️
serialized data
becomesprimitive data
👍🏻 Save/persist state of an object.
👍🏻 Travel an object across a network.
🛠️ How to serialize
- implement
java.io.Serializable
interface
✔️ SerialVersionUID
version number of serialization
used during Deserialization to verify that sender and receiver of a serialized object have loaded classes for that object which are compatible with respect to serialization
💡 Reference
This post is licensed under CC BY 4.0 by the author.