what is the exact purpose of serialization in detail
Serialization is the process of writing complete state of java object into output stream, that stream can be file or byte array or stream associated with TCP/IP socket.
It is a general mechanism to store and retrieve objects, by representing their state in a serialized form sufficient to reconstruct the object. When object is stored, all objects that are reachable from it are stored as well.
Serializable is a tagging interface; it prescribes no methods. It serves to assign the Serializable data type to the tagged class and to identify the class as one which the developer has designed for persistence. ObjectOutputStream serializes only those objects which implement this interface.