The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes gc Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Professional Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "gc" Watch "gc" New topic
Author

gc

TonyHuang
Greenhorn

Joined: Oct 13, 2000
Posts: 3
Question:
Passing a variable to an Array then setting the variable to null.
Is it eligible for garbage collection?
thanks
Sagar Sharma
Ranch Hand

Joined: Aug 31, 2000
Posts: 92
hi,
if it is an array of objects then setting the reference to null should make it available for GC. The arrray however holds the reference(null) to the object.
Hope it helps!!!
Sagar
TonyHuang
Greenhorn

Joined: Oct 13, 2000
Posts: 3

Sagar:
thanks
 
 
subject: gc
 
Threads others viewed
Running two threads
Home loans in India - fixed or floating ?
regard on k&b book
Dont declare global variables in Servlet
WA #1.....word association
developer file tools