Can anything be serialized as long as it implements Serializable?

前端 未结 3 838
余生分开走
余生分开走 2021-01-27 14:23

I\'ve already seen this: How to test in java that a class implements serializable correctly

I just have a more general question. If you create an object (say a circle) l

3条回答
  •  醉话见心
    2021-01-27 15:04

    All of the instance variables also need to be serializable as well. This can cause problems when you're working with an external library and your "serializable" class holds a reference to a non-serializable class.

提交回复
热议问题