这里面包含了一百多个JAVA源文件

源代码在线查看: e107. determining when an object is no longer used.txt

软件大小: 551 K
上传用户: maple_78
关键词: JAVA
下载地址: 免注册下载 普通下载 VIP

相关代码

				A weak reference is used to determine when an object is no longer being referenced. 
				    // Create the weak reference.
				    ReferenceQueue rq = new ReferenceQueue();
				    WeakReference wr = new WeakReference(object, rq);
				    
				    // Wait for all the references to the object.
				    try {
				        while (true) {
				            Reference r = rq.remove();
				            if (r == wr) {
				                // Object is no longer referenced.
				            }
				        }
				    } catch (InterruptedException e) {
				    }
				
							

相关资源