Which statement is true?

Given the code fragment:


Which statement is true?
A. After line 8, three objects are eligible for garbage collection
B. After line 8, two objects are eligible for garbage collection
C. After line 8, one object is eligible for garbage collection
D. After line 8, none of the objects are eligible for garbage collection

Download Printable PDF. VALID exam to help you PASS.

One thought on “Which statement is true?

  1. I believe the correct answer is B (two objects eligible for garbage collection).
    The reason is that each Student object contains a String object that will also be eligible for garbage collection when a Student object becomes eligible for garbage collection.

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.