This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread 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 Java 8 in Action this week in the Java 8 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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Preventing an object from being garbage collected (was SCJP)
 
Similar Threads
Garbage Collection.
Is there any way that we can prevent an object from being Garbage collected?
Garbage collection..
Is this true in Garbage Collection
garbage collection