Java serialization: readObject() vs. readResolve()

前端 未结 10 967
花落未央
花落未央 2020-12-02 04:07

The book Effective Java and other sources provide a pretty good explanation on how and when to use the readObject() method when working with serializable Java class

10条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-02 04:39

    readResolve() will ensure the singleton contract while serialization.
    Please refer

提交回复
热议问题