Object serialization is the process of saving an object’s state to a sequence of bytes. Does it saves only the instance variable or also the
object methods(like getter and setter methods) ?
Once we we write the object to outputstream or some text file, how does it get transmitted over network?
Do we write the java object state in a text file. right?
Object serialization is the process of saving an object’s state to a sequence of
Share
If you are using Java, when you serialize a object, the class code itself is not serialized. Instead, the output has a meta-data with your object class name(or some kind of reference to a class).
When you deserialize, java serialization machanism will look for this clas in your classpath.
To transmit over network, with java, you will use ObjectOutputStream with Network stream classes..
Read this also: java serialization over network
Hope this helps!