I'd like to copy the ArrayList zf into the ArrayList copyzf. The copy has to be a deep one.
I already tried:
public class ZFW {
Integer zfw;
public ZFW copy() {
ZFW m= new ZFW();
m.zfw=this.zfw.copy();
return m;
}
}
and in the executing code:
for(int r=0; r<zf.size();r++) {
Integer z;
z=zf.get(r);
copyzf.set(r, z.copy());
}
The error "The method copy() is undefined for the type Integer" occurs. I can't change the data type of the ArrayLists, does anybody know how I can solve the Problem? Thanks in advance!