Java: super.clone() method and inheritance

前端 未结 5 1898
栀梦
栀梦 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:28

    If clone() in B returns whatever clone() in A returns and clone() in C returns whatever the clone() in B returns then clone() in C will return whatever the clone() in A returns.

提交回复
热议问题