Whenever an object is to be sent over the network, objects need to be serialized. Moreover if the state of an object is to be saved, objects need to be serilazed.
Serialization is a mechanism by which you can save the state of an object by converting it to a byte stream.JAVA中实现serialization主要靠两个类:ObjectOuputStreamObjectInputStream他们是JAVA IO系统里的OutputStream和InputStream的子类自定义序列化的作用如下:Persist only meaningful data.