我正在经历序列化的过程,我分析的是不能序列化的成员是 transient 的和静态的,请告知除了这两个之外还有其他不能序列化的功能吗?请指教。
各位大佬请指教..!!
最佳答案
what I have analysed is that the memebers that can not be serialized are transisent and static ,
默认情况下不会序列化。这确实意味着它们无法通过自定义序列化进行序列化。注意:JDK 中有许多类具有 transient 字段,这些字段以自定义方式序列化。
Please advise is there any other functionality also that can not be serialized other than these two..?
您无法序列化未实现 Serialized 且非 transient
和非静态
的对象。
注意:您可以使用自定义序列化来序列化任何对象,只要其 transient
即可。
关于java - 关于包含无法连载的成员的连载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11877975/