Question: When is the object B in the following code eligible for garbage collection? (a) After line 5 (b) After line 6 (c) After line 7
When is the object B in the following code eligible for garbage collection?
(a) After line 5
(b) After line 6
(c) After line 7
(d) There is no way to be absolutely certain.
void start () { A a new A(); Bb = new B (); a.s (b); = b = null; /* Line 5 */ a = null; /* Line 6 */ System.out.println("start completed"); /* Line 7 */
Step by Step Solution
3.38 Rating (151 Votes )
There are 3 Steps involved in it
d There ... View full answer
Get step-by-step solutions from verified subject matter experts
