W
Walter Mitty
Is there a way to specifically call the last defined clone() method?
As a java newbie the following excerpt from the JDK help confuses me a
little.
"By convention, the returned object should be obtained by calling
super.clone. If a class and all of its superclasses (except Object) obey
this convention, it will be the case that x.clone().getClass() ==
x.getClass()."
Surely if classA inherist from classB which (obviously inherits from
Object)and then
ref = new classB()
then
ref.clone()
calls classB.clone() implicitly?
Or does java call the base method and it's up to the implementor to
propagate the clone up through the hierarchy?
As a java newbie the following excerpt from the JDK help confuses me a
little.
"By convention, the returned object should be obtained by calling
super.clone. If a class and all of its superclasses (except Object) obey
this convention, it will be the case that x.clone().getClass() ==
x.getClass()."
Surely if classA inherist from classB which (obviously inherits from
Object)and then
ref = new classB()
then
ref.clone()
calls classB.clone() implicitly?
Or does java call the base method and it's up to the implementor to
propagate the clone up through the hierarchy?