我将一个名为Node
的类定义为
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);
}
}
但是,当我做的时候
Node next_n = new Node(prev_n);
更改next_n
内容,prev_n
也会更改!
如何取消链接这些对象?