Question: How many objects are eligible for garbage collection when control reaches (1)? Select the one correct answer. (a) 0 (b) 5 (c) 10 (d) Hard

How many objects are eligible for garbage collection when control reaches (1)?

public class Link ( private Link next; Link (Link next) {this.next =

Select the one correct answer.

(a) 0

(b) 5

(c) 10

(d) Hard to say

public class Link ( private Link next; Link (Link next) {this.next = next; } public void finialize() { System.out.print ("X"); } public static void main(String[] args) { Link p= null; for (int i = 0; i < 5; i++) { p = new Link (p); System.gc (); // (1);

Step by Step Solution

3.37 Rating (166 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a All the object... 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 Java Programming 8th Questions!