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?
(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
d When the inst... View full answer
Get step-by-step solutions from verified subject matter experts
