英文:
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 ?
专注分享java语言的经验与见解,让所有开发者获益!
评论