A
Andrew Mallinson
Hi
Just wondering if someone could explain - the workings of the clone method
to me. Im aware that it creates a copy of the object. But say you have a
vector of Integers - and you clone the vector does the new vector have
different Integer objects (although of the same value) in it - or references
to the first vectors objects.
Now say you have a vector of your own objects(classes that youve created) -
that dont support the clone method. And you clone the vector - does java
create a new copy of each of the objects in the vector and put them into the
new vector or again are they just references.
Thanks very much inadvance for your help
Regards
Andy
Just wondering if someone could explain - the workings of the clone method
to me. Im aware that it creates a copy of the object. But say you have a
vector of Integers - and you clone the vector does the new vector have
different Integer objects (although of the same value) in it - or references
to the first vectors objects.
Now say you have a vector of your own objects(classes that youve created) -
that dont support the clone method. And you clone the vector - does java
create a new copy of each of the objects in the vector and put them into the
new vector or again are they just references.
Thanks very much inadvance for your help
Regards
Andy