Câu 3: GSSP-Java: GIAC Secure Software Programmer-Java
Mark works as a Programmer for InfoTech Inc. He creates a program that uses the following code.1. class Book2. {3. Short f1= 15;4. Book GetDetails(Book b1)5. {6. b1=null;7. return b1;8. }9. public static void main(String args[])10. {11. Book b1 = new Book();12. Book b2 = new Book();13. Book b3 = b1.GetDetails(b2);14.…
Nội dung câu hỏi
Mark works as a Programmer for InfoTech Inc. He creates a program that uses the following code.1. class Book2. {3. Short f1= 15;4. Book GetDetails(Book b1)5. {6. b1=null;7. return b1;8. }9. public static void main(String args[])10. {11. Book b1 = new Book();12. Book b2 = new Book();13. Book b3 = b1.GetDetails(b2);14. b1=null;15. //code16. }17. }How many objects will be eligible for garbage collection when line 15 is reached?
Các lựa chọn
Đáp án được giữ gọn theo nhãn A, B, C, D trong phần bình chọn tương tác.
- A. It cannot be determined.
- B. 1
- C. 2 — đáp án hiện tại
- D. 0
Cộng đồng
0 bình luận công khai. Tên thành viên được ẩn một phần.