springBoot 集合深度拷贝

springBoot 集合深度拷贝
强烈推介IDEA2021.1.3破解激活,IntelliJ IDEA 注册码,2021.1.3IDEA 激活码  

大家好,我是架构君,一个会写代码吟诗的架构师。今天说一说springBoot 集合深度拷贝,希望能够帮助大家进步!!!

springBoot 集合深度拷贝
如果为注释掉的写法的话运行结果为

目标数组元素:[{"sec2":"des2","sec1":"sec1"},{"sec4":"sec4","sec3":"sec3"}]
目标数组元素:[{"sec2":"des2","sec1":"sec1"},{"sec2":"des2","sec4":"sec4","sec3":"sec3"}]
目标数组元素:[{"sec2":"des2","sec1":"sec1"},{"sec2":"des2","sec4":"sec4","sec3":"sec3"}]
目标数组元素:[{"sec2":"des2","sec1":"sec1"},{"sec2":"des2","sec4":"sec4","sec3":"sec3"}]
目标数组元素:[{"sec2":"des2","sec1":"sec1"},{"sec2":"des2","sec4":"sec4","sec3":"sec3"}]
目标数组元素:[{"sec2":"des2","sec1":"sec1"},{"sec2":"des2","sec4":"sec4","sec3":"sec3"}]
源数组元素:[{"sec2":"des2","sec1":"sec1"},{"sec2":"des2","sec4":"sec4","sec3":"sec3"}]

用后边的这种流的方式MT4使用教程才是深度拷贝(使用序列化方法)

目标数组元素:[{"sec2":"des2","sec1":"sec1"},{"sec4":"sec4","sec3":"sec3"}]
目标数组元素:[{"sec2":"des2","sec1":"sec1"},{"sec2":"des2","sec4":"sec4","sec3":"sec3"}]
目标数组元素:[{"sec2":"des2","sec1":"sec1"},{"sec4":"sec4","sec3":"sec3"}]
目标数组元素:[{"sec2":"des2","sec1":"sec1"},{"sec2":"des2","sec4":"sec4","sec3":"sec3"}]
目标数组元素:[{"sec2":"des2","sec1":"sec1"},{"sec4":"sec4","sec3":"sec3"}]
目标数组元素:[{"sec2":"des2","sec1":"sec1"},{"sec2":"des2","sec4":"sec4","sec3":"sec3"}]
源数组元素:[{"sec2":"sec2","sec1":"sec1"},{"sec4":"sec4","sec3":"sec3"}]

注意  引入的为

   com.alibaba
   fastjson
   1.2.58
 

本文来源huayang183,由架构君转载发布,观点不代表Java架构师必看的立场,转载请标明来源出处:https://javajgs.com/archives/18123

发表评论