This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Preventing an object from being garbage collected (was SCJP) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Preventing an object from being garbage collected (was SCJP)" Watch "Preventing an object from being garbage collected (was SCJP)" New topic
Author

Preventing an object from being garbage collected (was SCJP)

Sophie Angela
Ranch Hand

Joined: Jul 17, 2006
Posts: 46
how can we make a object never be garbage collected?can we put static modifier before a object..so thet it is never garbage collected?
[ August 30, 2006: Message edited by: Barry Gaunt ]
Shaan Shar
Ranch Hand

Joined: Dec 27, 2005
Posts: 1249

Originally posted by Jaiganesh Elumalai:
how can we make a object never be garbage collected?can we put static modifier before a object..so thet it is never garbage collected?


You may find this link usefull....

The Truth About Garbage Collection

there is a term called Resurrection. Please read it carefully.
Hope this may be usefull for you.


The Best way to predict your future is to create it - Every great individual common man
Praveen Babu
Ranch Hand

Joined: Jul 30, 2006
Posts: 138
Originally posted by Jaiganesh Elumalai:
how can we make a object never be garbage collected?can we put static modifier before a object..so thet it is never garbage collected?


Yes, you can, static members are considered live members.
 
Don't get me started about those stupid light bulbs.
 
subject: Preventing an object from being garbage collected (was SCJP)