Question: When is the Demo object eligible for garbage collection? (a) After line 5 (b) After line 6 (c) After the start() method completes (d) When

When is the Demo object eligible for garbage collection?class Test { private Demo d; void start () { } } d = new Demo (); this.take Demo (d); /* Line 5 */ } /* Line

(a) After line 5

(b) After line 6

(c) After the start() method completes

(d) When the instance running this code is made eligible for garbage collection.

class Test { private Demo d; void start () { d } } new Demo (); this.take Demo (d); /* Line 5 */ } /* Line 6 */ void take Demo (Demo demo) { demo null; demo = new Demo ();

Step by Step Solution

3.44 Rating (151 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

d When the inst... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Advanced Java Programming Questions!