How to properly override clone method?

后端 未结 9 2158
时光说笑
时光说笑 2020-11-22 12:06

I need to implement a deep clone in one of my objects which has no superclass.

What is the best way to handle the checked CloneNotSupportedException thr

9条回答
  •  有刺的猬
    2020-11-22 12:35

    Use serialization to make deep copies. This is not the quickest solution but it does not depend on the type.

提交回复
热议问题