Java: super.clone() method and inheritance

前端 未结 5 1906
栀梦
栀梦 2020-12-13 21:22

I have a quick question regarding the clone() method in Java, used as super.clone() in regard to inheritance - where I call the clone()

5条回答
  •  鱼传尺愫
    2020-12-13 21:37

    Its a special native method. This was done to make cloning easier. Otherwise you will have to copy the whole code of your ancestor classes.

提交回复
热议问题