GIAC
GSSP-JAVA · Question #144
GSSP-JAVA Question #144: Real Exam Question with Answer & Explanation
Sign in or unlock GSSP-JAVA to reveal the answer and full explanation for question #144. The question stem and answer options stay visible for context.
Question
Mark works as a Programmer for InfoTech Inc. He develops the following code snippet. 1. public class Garbage 2. { 3. public static void main(String args[]) 4. { 5. String line; 6. String first="it is a program"; 7. String last="last argument"; 8. String arg1=new String((args.length>0) ? "'" + args[0] + "'" . "no arguments"); 9. line=arg1; 10. arg1=null; 11. line=first + line + last; 12. first=null; 13. System.out.println("line"); 14. line=null; 15. last=null; 16. args=null; 17. } 18. } Which of the following statements about the code snippet is true when an object is initially referenced with arg1, and it is eligible for garbage collection?
Options
- AAfter line 10.
- BAfter line 15.
- CAfter line 12.
- DAfter line 11.
Unlock GSSP-JAVA to see the answer
You've previewed enough free GSSP-JAVA questions. Unlock GSSP-JAVA for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.