|
|
|
1000 Java Tips ebook
|
|
 

Free "1000 Java Tips" eBook is here! It is huge collection of big and small Java
programming articles and tips. Please take your copy here.
Take your copy of free "Java Technology Screensaver"!. |
|
I read that an object can be strongly, weakly or even phantom (!!!!) reachable..
|
JavaFAQ Home » File systems

Question: I read that an object can be
strongly, weakly or even phantom (!!!!) reachable...
???
Answer: I found the definitions in API. I
think it is clear enough to be cited here:
Going from strongest to weakest, the different levels of
reachability reflect the life cycle of an object. They are
operationally defined as follows:
- An object is strongly reachable if it can be reached by some
thread without traversing any reference objects. A newly-created
object is strongly reachable by the thread that created it.
- An object is softly reachable if it is not strongly reachable but can be
reached by traversing a soft reference.
- An object is weakly reachable if it is neither strongly nor softly
reachable but can be reached by traversing a weak reference. When the weak
references to a weakly-reachable object are cleared,
the object becomes eligible for finalization.
- An object is phantom reachable if it is neither strongly, softly,
nor weakly reachable, it has been finalized, and some phantom
reference refers to it.
- Finally, an object is unreachable, and therefore eligible for
reclamation, when it is not reachable in any of the above ways.
About phantom reference please read more in API
(java.lang.ref.PhantomReference)
*******************************************
Our older tips: March 22, 2001 - October 21, 2002
READ
HERE
All published and not published on the site tips read
HERE Printer Friendly Page
Send to a Friend
..
Search here again if you need more info!
|
|
|