When is the b object created in line 3 eligible for garbage


void start() {  
    A a = new A(); 
    B b = new B(); 
    a.s(b);  
    b = null; /* Line 5 */
    a = null;  /* Line 6 */
    System.out.println("start completed"); /* Line 7 */
} 

When is the B object, created in line 3, eligible for garbage collection?

A. behind line 5
B. after line 6
C. just after line 7
D. There is no way one can be absolutely certain.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: When is the b object created in line 3 eligible for garbage
Reference No:- TGS01415105

Now Priced at $10 (50% Discount)

Recommended (93%)

Rated (4.5/5)