I’m trying to develop a Data Structure in Java and I’m facing a problem that I just can’t solve. I have a reference to an object, and, after copying it, I want to change the original reference using only the copy. For example:
Point a = new Point(0,0);
Point b = a;
b = new Point(5,5);
I want “a” to point to “new Point(5,5)” too, and not only “b”. Is there anyway to do that?
Thanks for the help.
1 Answer