Very Urgent : Garbage Collection in JAVA

Plz tell me:

1 public class x{

2 public Object m(){

3 Object o=new Float(2.14F);

4 Object [] oa=new Object[1];

5 oa[0]=o;

6 o=null;

7 return o;

8 }

9 }

When is the Float object creation in line 3 eligible for garbage collection ?

[306 byte] By [sanjeev_vjtia] at [2007-9-19]
# 1
I think: Any time after 6.
samlewis23a at 2007-7-8 > top of java,Archived Forums,Java Programming [Archive]...
# 2
Anytime after line 8, as the Object[] oa[0] retains a reference to the object formerly referenced by o and so oa has to go out of scope, making both the Object[] and the Float available for garbage collection.
cmccorveya at 2007-7-8 > top of java,Archived Forums,Java Programming [Archive]...
# 3
for that u must want to write another method because if u assign the objects it will do bit copyso both are point to the same memory location.so if u want garbage collection u must write another method
aluvalaia at 2007-7-8 > top of java,Archived Forums,Java Programming [Archive]...
# 4
Definitely any time after 8. Until that point, the array oa is still in scope, and holds a reference to the object originally referenced by o.HTH
asquitheaa at 2007-7-8 > top of java,Archived Forums,Java Programming [Archive]...
# 5
I change my mind, i agree after 8, forgot about the array.
samlewis23a at 2007-7-8 > top of java,Archived Forums,Java Programming [Archive]...