File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Regarding ReferenceQueue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Regarding ReferenceQueue" Watch "Regarding ReferenceQueue" New topic
Author

Regarding ReferenceQueue

surya.raaj prakash
Ranch Hand

Joined: Oct 30, 2009
Posts: 76
Hi Friends,

Use of Reference Queue with soft reference and weak reference is optional,
but each phantom reference you must be associated with ReferenceQueue, WHY?
surya.raaj prakash
Ranch Hand

Joined: Oct 30, 2009
Posts: 76
Any Reply/
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18101
    
  39

surya.raaj prakash wrote:but each phantom reference you must be associated with ReferenceQueue, WHY?


Okay, let's assume that there was an option to declare a phantom reference without a ReferenceQueue -- how do you propose that it be used?

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Regarding ReferenceQueue
 
Similar Threads
garbage collection
Cache Reference Information
NX: Thread safe and WeakHashMap vs. Unrefence Interface
find number of objects for a particular class and create objects accordingly?
What exactly is enqueued in a ReferenceQueue