Created
October 20, 2014 08:01
-
-
Save simlegate/5b72524616ec2db261aa to your computer and use it in GitHub Desktop.
Java垃圾回收机制循环引用问题
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class A{ | |
public B b; | |
} | |
class B{ | |
public A a; | |
} | |
public class Main{ | |
public static void main(String[] args){ | |
A a = new A(); | |
B b = new B(); | |
a.b=b; | |
b.a=a; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment