Serialization of anonymous class in Java

前端 未结 4 1883
醉话见心
醉话见心 2021-01-12 12:59

Is it possible to searialize/desearialize anonymous class in Java?

Example:

ByteArrayOutputStream operationByteArrayStream = new ByteArrayOutputStrea         


        
4条回答
  •  -上瘾入骨i
    2021-01-12 13:41

    Note that in addition to Task implementing Serializable, the outer class must also be Serializable. You may end up serializing unnecessary member states.

提交回复
热议问题