my dog learned polymorphism*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Garbage Collection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Garbage Collection" Watch "Garbage Collection" New topic

Garbage Collection

Mathew Sam
Ranch Hand

Joined: Dec 19, 2001
Posts: 124

When the Object created in line1 is ready for garbage collection?.
Will it be ready just after line1 ?
[ June 11, 2002: Message edited by: Mathew Sam ]
Corey McGlone
Ranch Hand

Joined: Dec 20, 2001
Posts: 3271
Yes. There is no reference to the object after that line is executed, so it is eligible for garbage collection after line 1.

SCJP Tipline, etc.
It is sorta covered in the JavaRanch Style Guide.
subject: Garbage Collection
Similar Threads
garbage collection
is this object eligible for garbage collection??
garbage collector......output.....?
Number of Objects eligible for Garbage Collection
Garbage Collection