Java SE 8 Programmer II Practice Questions

Previous   Next

6.Given the following:

1     class base
2     {
3     }
4
5     class child 
6     {
7     static base b;
8     }
9     public class Testing 
10     {
11     public static void main(String args[])
12     {
13     base b1=new base();
14     base b2=new base();
15     child c1=new child();
16     c1.b=b2;
17     child c2=c1.b;
18     c2.b=c1.b;
19     child c3=c2
20     c2.b=null;
21     // code here
22     }
23     }

How many objects are eligible for garbage collection at line 21
1

2

3

4




Your Answer =


Answer / Explanation:

CertExams Blog!  Certexams.com Facebook Page Certexams.com Twitter Page Certexams on YouTube 


Cert-Ex™ Exam Simulators, Cert-Ex™ Network Simulator, Cert-Ex™ Cheatsheets are written independently by CertExams.com and not affiliated or authorized by respective certification providers. Cert-Ex™ is a trade mark of CertExams.com or entity representing Certexams.com.Java™ is a trademark of Oracle® Corporation