Java allows us to clone an object, usually used in decorator and prototype patterns. So what is a deep clone and what is a shallow clone.
[Shallow clone], usually just copy the cloned instance, but other sub-objects in it are shared.
[Deep clone], when cloning, it will copy the references of its sub-objects, and all the variables and sub-objects in it are additionally copied.
Original link:
https://www.cnblogs.com/xing901022/p/4051097.html