I have an Object A. I assign values from A to Object B. Object A is then changed, but I want to maintain the original values in Object B.
ObjectA a = getObjectAValues();
ObjectB b = new ObjectB();
b.setval(a.getValA());
//object A updated here
return b;
When I check the second object, it has the updated values, rather than the original value when I first assigned it. Any ideas how to get past this?