先看个10个面试题:
http://it.deepinmind.com/java/2014/05/25/why-use-serialversionuid-inside-serializable-class-in-java.html
http://en.deepinmind.com/blog/2014/05/25/top-10-java-serialization-interview.html 10个面试
refer to http://developer.51cto.com/art/201202/317181.htm?from=timeline&isappinstalled=1
先说一个 序列化对象中A 如果包含一个 没有implement Serializable接口的对象B
如果你对A做序列化,那么就会报出 Exception in thread "main" java.io.NotSerializableException: 的错误
此时如果你不需要 序列化B 就在成员变量B前 加transient
另外思考一个问题,所有静态变量 无论在A中还是在B中 被反序列化出来的对象中 都可以取到它的值,貌似这个值 只要类被加载就会产生,序列化时应该是不序列 静态对象的