java对于序列化破坏单例的解决方案

再类中添加一个readResolve方法(非静态),方法直接返回单例对象

 

posted @ 2022-07-25 23:37  dronff  阅读(42)  评论(0)    收藏  举报