Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于虚引用问题 #896

Open
JulyJunWu opened this issue Mar 21, 2020 · 1 comment
Open

关于虚引用问题 #896

JulyJunWu opened this issue Mar 21, 2020 · 1 comment

Comments

@JulyJunWu
Copy link

1.虚引用必须配合引用队列使用
2.在对虚引用的描述未说明,且案例也是错误示范.
从JDK的PhantomReference源码可知,该类只有一个构造器,如下
PhantomReference(T referent, ReferenceQueue<? super T> q);

@wangpeipei90
Copy link

Plus, calling get() on a PhantomReference always returns null.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants