分类: Java
2014-06-15 10:48:19
实现序列号接口(Serializable),标记这个类可以被序列化。 “I’m fine to be serialized”.
当你尝试序列化没有实现Serializable接口的对象时,将会抛出异常 NotSerializableException.
The idea is to be able to transparently serialize instances of the class – potentially for caching or other purposes, I’m not sure in this case. The serialVersionUID field is just part of the versioning that Java binary serialization uses.
参考: