0

I defined a class called Node as

private class Node {
      public Node father;
      public JigSaw js;
      public int dist;

      public Node(Node father, JigSaw js, int d){
        this.father = father;
        this.js  = js;
        this.dist = d;
      }
      public Node(Node aux){
        this(aux.father, aux.js, aux.dist);
      }
}

But, when I do

Node next_n = new Node(prev_n);

And change next_n contents, prev_n changes too! How can I get these objects unlinked?

0 Answers0