Java垃圾收集如何处理循环引用?
class Node { public object value; public Node next; public Node(object o, Node n) { value = 0; next = n;}}//...some code{ Node a = new Node("a", null), b = new Node("b", a), c = new Node("c", b); a.next = c;} //end of scope//...other code
a
, b
c
相关分类