public class X { public static void main(String [] args) { X x = new X(); X x2 = m1(x); /* Line 6 */ X x4 = new X(); x2 = x4; /* Line 8 */ doComplexStuff(); } static X m1(X mx) { mx = new X(); return mx; } } After line 8 runs. how many objects are eligible for garbage collection? - Study24x7
Social learning Network
09 Mar 2023 06:41 PM study24x7 study24x7

public class X { public static void main(String [] args) { X x = new X(); X x2 = m1(x); /* Line 6 */ X x4 = new X(); x2 = x4; /* Line 8 */ doComplexStuff(); } static X m1(X mx) { mx = new X(); return m...

See more

A

0  

B

1

C

2

D

3

study24x7
Write a comment
Related Questions
500+   more Questions to answer
Most Related Articles