目录 深拷贝与浅拷贝区别 hutool BeanUtil.copyProperties 浅拷贝问题重现 实现深拷贝的一些工具 深拷贝与浅拷贝区别 在 Java 中,除了基本数据类型(元类型)之外,还存在类的实例对象这个引用数据类型.而一般使用 『 = 』号做赋值操作的时候.对于基本数据类型,实际上是拷贝的它的值,但是对于对象而言,其实赋值的只是这个对象的引用,将原对象的引用传递过去,他们实际上还是指向的同一个对象. 而浅拷贝和深拷贝就是在这个基础之上做的区分,如果在拷贝这个对象的时候,只对基本数