Serialization问题
Serialization only persist state of object and not object itself.
static variables and Transient variables are not included in java serialization process and are not the part of the object’s serialized state.
if you don't store values of these variables then what would be value of these variable once you deserialize and recreate those object?
state of object是指什么?
什么情况下用到Serialization?
------解决方案--------------------state of object 是指对象的状态。序列化是将对象的状态转换成可保持或可传输格式的过程。发序列化与他相反,他将流转换成对象。只有与对象相对应的类实现了Serializable接口的对象才能序列化。序列化的对象能使用ObjectOutputStream将对象的状态存储在磁盘上或写在网络上,用ObjectInputStream能将此状态读取出来组成原来的对象。