I'm using Java 1.4.1 ; I'm trying to something like this, I get an error that says clone() is not defined for Cloneable...
public class DeepCloneableVector extends Vector implements Cloneable{
public Object clone()
{
DeepCloneableVector v = (DeepCloneableVector)super.clone();
int size = this.size();
for (int i=0; i
{
Cloneable element = (Cloneable)get(i); //get element in this vector
//set the element in the next vector
v.setElementAt(element.clone(), i);
}
return v;
}
}
2006-06-24
06:12:04
·
2 answers
·
asked by
shellsandscripts
2
in
Computers & Internet
➔ Programming & Design