The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
January 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Garbage collection

Posted by Kumar on January 21, 2001 at 11:45 PM

Our project team is venturing on a new large scale project in Java. In doing some evaluations, naturally we discussed the topic of Garbage collection.
The garbage collection in Java is automatic and we don't have any control when an object is actually garbage collected.
We are thinking about setting the objects to null after they have been used. Is this a good coding technique, or are there better techniques involved.
Appreciate some help on this.

Example:
void foo()
{
SomeClass a = new SomeClass();
a.method1();
a.method2();
a = null;
}




Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us