GIAC GSSP-Java Question Answer
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?
GIAC GSSP-Java Summary
- Vendor: GIAC
- Product: GSSP-Java
- Update on: Jul 25, 2025
- Questions: 275