File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Garbage Collection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Garbage Collection" Watch "Garbage Collection" New topic

Garbage Collection

Kaustubh Bansal

Joined: Jan 19, 2009
Posts: 2
Is it possible for an unreferenced object to be in use?

In this code, we are adding a button to a content pane to a frame. Is this content pane eligible for garbage collection?
Daesung Park
Ranch Hand

Joined: Mar 22, 2007
Posts: 68
The content pane is not garbage-collected as long as frame is a live object.

Daesung Park

Campbell Ritchie

Joined: Oct 13, 2005
Posts: 43321
Kaustubh Bansal wrote:Is it possible for an unreferenced object to be in use?
Read your question very very carefully . . .
It is sorta covered in the JavaRanch Style Guide.
subject: Garbage Collection
It's not a secret anymore!