chenwei
asked on
How to clone an object complettly?
Assumed I have a class which contains elements of other classes as follow:
public ClassB{
...
}
public ClassA{
...
private String str1;
private B b;
...
}
I can clone the A as follow:
...
A a = new A();
A c = a.clone();
But this will just clone the member str1. How can I clone the A complettly?
public ClassB{
...
}
public ClassA{
...
private String str1;
private B b;
...
}
I can clone the A as follow:
...
A a = new A();
A c = a.clone();
But this will just clone the member str1. How can I clone the A complettly?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.