Why can't we achieve deep cloning through getters in java why we need prototype design pattern with Cloneable interface?

huangapple 未分类评论40阅读模式
英文:

Why can't we achieve deep cloning through getters in java why we need prototype design pattern with Cloneable interface?

问题

我需要知道的是,在我们需要深度克隆一个实例的情况下,为什么不能通过使用原始对象的getter方法来实现,为什么我们需要像Cloneable这样的特定设计模式或接口?

英文:

I need to know in a case of we need to clone an instance deeply why can't we achieve that using the getter method of our original object why we need any specific design pattern or interface like Cloneable ?

huangapple
  • 本文由 发表于 2020年7月23日 17:00:00
  • 转载请务必保留本文链接:https://java.coder-hub.com/63050588.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定