Author
Question for varargs for array and garbage collection
PujaR Agarwal
Greenhorn
Joined: Mar 30, 2009
Messages: 14
posted Jun 18, 2009 04:46:08
The following is from Mr. Devaka's ExamLab SCJP Simulator :
Practice Exam 1, question 42:
How many objects are eligible for the Garbage Collector, after executing the line-9 of this programm. F.Y.I: Array is an object.
According to ExamLab the answer is: 0
This problem is already discussed here but one forum is showing answer 1 and one is showing 0. which is true ? Can anyone help me.
Solution 1 :http://www.coderanch.com/t/418039/Programmer-Certification-SCJP/certification/about-Garbage-Collection-from-ExamLab#1843490
Solution 2 : http://www.coderanch.com/t/431013/Programmer-Certification-SCJP/certification/Devak-ExamLab-Garbage-Collection#1914089
Thanks
Puja
Devaka Cooray
Rancher
Joined: Jul 29, 2008
Messages: 1108
posted Jun 18, 2009 05:18:24
When did you download examlab? Before April, or After April?
Author of ExamLab - the free mock exam kit for SCJP (Write a Review )
[My Home Page ] . [Twitter Profile ] . [JavaRanch FAQ ] . [How to Ask a Question ]
PujaR Agarwal
Greenhorn
Joined: Mar 30, 2009
Messages: 14
posted Jun 18, 2009 05:33:30
I downloaded examlab after april only but it is showing 19/4/09 version.
Devaka Cooray
Rancher
Joined: Jul 29, 2008
Messages: 1108
posted Jun 18, 2009 05:40:18
PujaR Agarwal wrote: I downloaded examlab after april only but it is showing 19/4/09 version.
Then please read the question again:
How many "objects of Gabc class " are eligible for the Garbage collector, after executing the line-9 of this program?
The correct answer is 0 in this case.
(There was a small error in the previous version)
Author of ExamLab - the free mock exam kit for SCJP (Write a Review )
[My Home Page ] . [Twitter Profile ] . [JavaRanch FAQ ] . [How to Ask a Question ]
PujaR Agarwal
Greenhorn
Joined: Mar 30, 2009
Messages: 14
posted Jun 18, 2009 05:45:27
Thanks Devaka to make it clear.