i stumbled upon this problem....pls suggest some way
--- Update ---
i tried the following code ...but it is not working:
class DeepCopy implements Cloneable{ String par; DeepCopy o1; public static void main(String a[]) { DeepCopy dummy=new DeepCopy(); dummy.go(); } void go(){ o1=new DeepCopy(); o1.par="33"; DeepCopy o2=(DeepCopy)o1.clone(); System.out.println(o2.par); } public Object clone(){ try{ DeepCopy o2=(DeepCopy)super.clone(); o2.par=(String)o1.par.clone(); return o2; } catch(CloneNotSupportedException e) { return null; } } }